ops.go 982 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package daemon
  2. import "github.com/docker/docker/internal/test/environment"
  3. // WithExperimental sets the daemon in experimental mode
  4. func WithExperimental(d *Daemon) {
  5. d.experimental = true
  6. }
  7. // WithDockerdBinary sets the dockerd binary to the specified one
  8. func WithDockerdBinary(dockerdBinary string) func(*Daemon) {
  9. return func(d *Daemon) {
  10. d.dockerdBinary = dockerdBinary
  11. }
  12. }
  13. // WithSwarmPort sets the swarm port to use for swarm mode
  14. func WithSwarmPort(port int) func(*Daemon) {
  15. return func(d *Daemon) {
  16. d.SwarmPort = port
  17. }
  18. }
  19. // WithSwarmListenAddr sets the swarm listen addr to use for swarm mode
  20. func WithSwarmListenAddr(listenAddr string) func(*Daemon) {
  21. return func(d *Daemon) {
  22. d.swarmListenAddr = listenAddr
  23. }
  24. }
  25. // WithEnvironment sets options from internal/test/environment.Execution struct
  26. func WithEnvironment(e environment.Execution) func(*Daemon) {
  27. return func(d *Daemon) {
  28. if e.DaemonInfo.ExperimentalBuild {
  29. d.experimental = true
  30. }
  31. }
  32. }