From 1bd703c01719af6961ebce9532116ae3e7d1d53a Mon Sep 17 00:00:00 2001 From: Bogdan Popescu <68062990+bopopescu@users.noreply.github.com> Date: Wed, 22 Jul 2020 08:21:46 +0300 Subject: [PATCH] Removal of master-slave words --- containerd/containerd-shim/console.go | 16 ++-- containerd/containerd-shim/console_solaris.go | 2 +- containerd/containerd-shim/process_linux.go | 12 +-- containerd/integration-test/check_test.go | 12 +-- .../moby-17.05.0-ce/api/types/mount/mount.go | 12 +-- .../cli/command/network/create.go | 2 +- .../cli/compose/convert/volume_test.go | 2 +- .../cli/compose/loader/volume_test.go | 4 +- docker/moby-17.05.0-ce/daemon/create.go | 2 +- .../daemon/graphdriver/devmapper/deviceset.go | 8 +- docker/moby-17.05.0-ce/daemon/inspect.go | 2 +- docker/moby-17.05.0-ce/daemon/oci_linux.go | 28 +++--- .../distribution/xfer/transfer.go | 16 ++-- .../integration-cli-on-swarm/host/compose.go | 8 +- .../integration-cli-on-swarm/host/host.go | 28 +++--- .../integration-cli/docker_cli_build_test.go | 4 +- .../integration-cli/docker_cli_run_test.go | 14 +-- .../docker_experimental_network_test.go | 86 ++++++++--------- docker/moby-17.05.0-ce/layer/layer.go | 40 ++++---- docker/moby-17.05.0-ce/layer/ro_layer.go | 20 ++-- .../libcontainerd/process_unix.go | 2 +- .../pkg/devicemapper/devmapper_wrapper.go | 2 +- .../pkg/gitutils/gitutils_test.go | 14 +-- docker/moby-17.05.0-ce/pkg/mount/flags.go | 8 +- .../moby-17.05.0-ce/pkg/mount/flags_linux.go | 2 +- .../pkg/mount/mount_unix_test.go | 6 +- .../pkg/mount/mounter_linux_test.go | 10 +- .../pkg/mount/mountinfo_linux.go | 2 +- .../pkg/mount/sharedsubtree_linux.go | 12 +-- .../pkg/mount/sharedsubtree_linux_test.go | 10 +- .../pkg/mount/sharedsubtree_solaris.go | 12 +-- .../moby-17.05.0-ce/reference/store_test.go | 4 +- .../libnetwork/drivers/bridge/bridge.go | 6 +- .../bridge/netlink_deprecated_linux.go | 16 ++-- .../bridge/netlink_deprecated_unsupported.go | 6 +- .../drivers/ipvlan/ipvlan_network.go | 10 +- .../libnetwork/drivers/ipvlan/ipvlan_setup.go | 14 +-- .../drivers/macvlan/macvlan_network.go | 10 +- .../drivers/macvlan/macvlan_setup.go | 14 +-- .../docker/libnetwork/etchosts/etchosts.go | 2 +- .../docker/libnetwork/ipam/structures.go | 6 +- .../docker/libnetwork/ipam/utils.go | 6 +- .../github.com/docker/libnetwork/network.go | 10 +- .../docker/libnetwork/osl/interface_linux.go | 36 ++++---- .../docker/libnetwork/osl/namespace_linux.go | 12 +-- .../docker/libnetwork/osl/options_linux.go | 4 +- .../docker/libnetwork/osl/sandbox.go | 10 +- .../docker/swarmkit/agent/session.go | 2 +- .../docker/swarmkit/api/types.pb.go | 6 +- .../networkallocator/portallocator.go | 24 ++--- .../swarmkit/manager/scheduler/scheduler.go | 2 +- .../docker/swarmkit/remotes/remotes.go | 6 +- .../vendor/github.com/kr/pty/pty_freebsd.go | 6 +- .../vendor/github.com/kr/pty/pty_linux.go | 2 +- .../vendor/github.com/miekg/dns/xfr.go | 4 +- .../vishvananda/netlink/handle_unspecified.go | 6 +- .../github.com/vishvananda/netlink/link.go | 16 ++-- .../vishvananda/netlink/link_linux.go | 92 +++++++++---------- .../netlink/netlink_unspecified.go | 6 +- .../volume/volume_propagation_linux_test.go | 28 +++--- .../docker/docker/pkg/mount/flags.go | 4 +- .../docker/docker/pkg/mount/flags_linux.go | 2 +- .../docker/pkg/mount/mountinfo_linux.go | 2 +- .../docker/pkg/mount/sharedsubtree_linux.go | 12 +-- opencontainers/runc/create.go | 2 +- opencontainers/runc/exec.go | 2 +- opencontainers/runc/libcontainer/console.go | 4 +- .../runc/libcontainer/console_freebsd.go | 2 +- .../runc/libcontainer/console_linux.go | 56 +++++------ .../runc/libcontainer/console_solaris.go | 2 +- .../runc/libcontainer/criurpc/criurpc.pb.go | 8 +- .../libcontainer/integration/exec_test.go | 8 +- .../runc/libcontainer/specconv/spec_linux.go | 8 +- opencontainers/runc/run.go | 2 +- 74 files changed, 439 insertions(+), 439 deletions(-) diff --git a/containerd/containerd-shim/console.go b/containerd/containerd-shim/console.go index 1d3262d..76b09be 100755 --- a/containerd/containerd-shim/console.go +++ b/containerd/containerd-shim/console.go @@ -10,17 +10,17 @@ import ( ) // NewConsole returns an initialized console that can be used within a container by copying bytes -// from the master side to the slave that is attached as the tty for the container's init process. +// from the main side to the subordinate that is attached as the tty for the container's init process. func newConsole(uid, gid int) (*os.File, string, error) { - master, err := os.OpenFile("/dev/ptmx", syscall.O_RDWR|syscall.O_NOCTTY|syscall.O_CLOEXEC, 0) + main, err := os.OpenFile("/dev/ptmx", syscall.O_RDWR|syscall.O_NOCTTY|syscall.O_CLOEXEC, 0) if err != nil { return nil, "", err } - console, err := ptsname(master) + console, err := ptsname(main) if err != nil { return nil, "", err } - if err := unlockpt(master); err != nil { + if err := unlockpt(main); err != nil { return nil, "", err } if err := os.Chmod(console, 0600); err != nil { @@ -29,7 +29,7 @@ func newConsole(uid, gid int) (*os.File, string, error) { if err := os.Chown(console, uid, gid); err != nil { return nil, "", err } - return master, console, nil + return main, console, nil } func ioctl(fd uintptr, flag, data uintptr) error { @@ -39,14 +39,14 @@ func ioctl(fd uintptr, flag, data uintptr) error { return nil } -// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f. -// unlockpt should be called before opening the slave side of a pty. +// unlockpt unlocks the subordinate pseudoterminal device corresponding to the main pseudoterminal referred to by f. +// unlockpt should be called before opening the subordinate side of a pty. func unlockpt(f *os.File) error { var u int32 return ioctl(f.Fd(), syscall.TIOCSPTLCK, uintptr(unsafe.Pointer(&u))) } -// ptsname retrieves the name of the first available pts for the given master. +// ptsname retrieves the name of the first available pts for the given main. func ptsname(f *os.File) (string, error) { var n int32 if err := ioctl(f.Fd(), syscall.TIOCGPTN, uintptr(unsafe.Pointer(&n))); err != nil { diff --git a/containerd/containerd-shim/console_solaris.go b/containerd/containerd-shim/console_solaris.go index 37b3368..7719a11 100755 --- a/containerd/containerd-shim/console_solaris.go +++ b/containerd/containerd-shim/console_solaris.go @@ -8,7 +8,7 @@ import ( ) // NewConsole returns an initalized console that can be used within a container by copying bytes -// from the master side to the slave that is attached as the tty for the container's init process. +// from the main side to the subordinate that is attached as the tty for the container's init process. func newConsole(uid, gid int) (*os.File, string, error) { return nil, "", errors.New("newConsole not implemented on Solaris") } diff --git a/containerd/containerd-shim/process_linux.go b/containerd/containerd-shim/process_linux.go index 9336d63..6fdb2f7 100755 --- a/containerd/containerd-shim/process_linux.go +++ b/containerd/containerd-shim/process_linux.go @@ -40,20 +40,20 @@ func (p *process) openIO() error { p.stdinCloser = stdinCloser if p.state.Terminal { - master, console, err := newConsole(uid, gid) + main, console, err := newConsole(uid, gid) if err != nil { return err } - p.console = master + p.console = main p.consolePath = console stdin, err := fifo.OpenFifo(ctx, p.state.Stdin, syscall.O_RDONLY, 0) if err != nil { return err } - //io.Copy将stdin/stdout与master相连 + //io.Copy将stdin/stdout与main相连 //p.state.Stdout和p.state.Stderr(方式为可读写)分别与i.Stdou和i.Stderr相连。接着打开p.state.Stdin为只读模式,再将i.Stdin和p.state.Stdin相连 - go io.Copy(master, stdin) + go io.Copy(main, stdin) stdoutw, err := fifo.OpenFifo(ctx, p.state.Stdout, syscall.O_WRONLY, 0) if err != nil { return err @@ -64,8 +64,8 @@ func (p *process) openIO() error { } p.Add(1) go func() { - io.Copy(stdoutw, master) - master.Close() + io.Copy(stdoutw, main) + main.Close() stdoutr.Close() stdoutw.Close() p.Done() diff --git a/containerd/integration-test/check_test.go b/containerd/integration-test/check_test.go index 044f5b3..2d65b66 100755 --- a/containerd/integration-test/check_test.go +++ b/containerd/integration-test/check_test.go @@ -123,7 +123,7 @@ func (cs *ContainerdSuite) StopDaemon(kill bool) { select { case err := <-cs.syncChild: if err != nil { - fmt.Printf("master containerd did not exit cleanly: %v\n", err) + fmt.Printf("main containerd did not exit cleanly: %v\n", err) } done = true case <-time.After(3 * time.Second): @@ -203,17 +203,17 @@ func (cs *ContainerdSuite) SetUpSuite(c *check.C) { // Create our output directory cs.outputDir = fmt.Sprintf(utils.OutputDirFormat, time.Now().Format("2006-01-02_150405.000000")) - cs.stateDir = filepath.Join(cs.outputDir, "containerd-master") + cs.stateDir = filepath.Join(cs.outputDir, "containerd-main") if err := os.MkdirAll(cs.stateDir, 0755); err != nil { c.Fatalf("Unable to created output directory '%s': %v", cs.stateDir, err) } - cs.grpcSocket = "unix://" + filepath.Join(cs.outputDir, "containerd-master", "containerd.sock") - cdLogFile := filepath.Join(cs.outputDir, "containerd-master", "containerd.log") + cs.grpcSocket = "unix://" + filepath.Join(cs.outputDir, "containerd-main", "containerd.sock") + cdLogFile := filepath.Join(cs.outputDir, "containerd-main", "containerd.log") f, err := os.OpenFile(cdLogFile, os.O_CREATE|os.O_TRUNC|os.O_RDWR|os.O_SYNC, 0777) if err != nil { - c.Fatalf("Failed to create master containerd log file: %v", err) + c.Fatalf("Failed to create main containerd log file: %v", err) } cs.logFile = f @@ -232,7 +232,7 @@ func (cs *ContainerdSuite) TearDownSuite(c *check.C) { select { case err := <-cs.syncChild: if err != nil { - c.Errorf("master containerd did not exit cleanly: %v", err) + c.Errorf("main containerd did not exit cleanly: %v", err) } done = true case <-time.After(3 * time.Second): diff --git a/docker/moby-17.05.0-ce/api/types/mount/mount.go b/docker/moby-17.05.0-ce/api/types/mount/mount.go index 2744f85..d866486 100755 --- a/docker/moby-17.05.0-ce/api/types/mount/mount.go +++ b/docker/moby-17.05.0-ce/api/types/mount/mount.go @@ -45,10 +45,10 @@ const ( PropagationRShared Propagation = "rshared" // PropagationShared SHARED PropagationShared Propagation = "shared" - // PropagationRSlave RSLAVE - PropagationRSlave Propagation = "rslave" - // PropagationSlave SLAVE - PropagationSlave Propagation = "slave" + // PropagationRSubordinate RSLAVE + PropagationRSubordinate Propagation = "rsubordinate" + // PropagationSubordinate SLAVE + PropagationSubordinate Propagation = "subordinate" ) // Propagations is the list of all valid mount propagations @@ -57,8 +57,8 @@ var Propagations = []Propagation{ PropagationPrivate, PropagationRShared, PropagationShared, - PropagationRSlave, - PropagationSlave, + PropagationRSubordinate, + PropagationSubordinate, } // Consistency represents the consistency requirements of a mount. diff --git a/docker/moby-17.05.0-ce/cli/command/network/create.go b/docker/moby-17.05.0-ce/cli/command/network/create.go index 90119af..cc62007 100755 --- a/docker/moby-17.05.0-ce/cli/command/network/create.go +++ b/docker/moby-17.05.0-ce/cli/command/network/create.go @@ -67,7 +67,7 @@ func newCreateCommand(dockerCli *command.DockerCli) *cobra.Command { flags.StringVar(&opts.ipamDriver, "ipam-driver", "default", "IP Address Management Driver") flags.StringSliceVar(&opts.ipamSubnet, "subnet", []string{}, "Subnet in CIDR format that represents a network segment") flags.StringSliceVar(&opts.ipamIPRange, "ip-range", []string{}, "Allocate container ip from a sub-range") - flags.StringSliceVar(&opts.ipamGateway, "gateway", []string{}, "IPv4 or IPv6 Gateway for the master subnet") + flags.StringSliceVar(&opts.ipamGateway, "gateway", []string{}, "IPv4 or IPv6 Gateway for the main subnet") flags.Var(&opts.ipamAux, "aux-address", "Auxiliary IPv4 or IPv6 addresses used by Network driver") flags.Var(&opts.ipamOpt, "ipam-opt", "Set IPAM driver specific options") diff --git a/docker/moby-17.05.0-ce/cli/compose/convert/volume_test.go b/docker/moby-17.05.0-ce/cli/compose/convert/volume_test.go index 73d642e..a6fe0a9 100755 --- a/docker/moby-17.05.0-ce/cli/compose/convert/volume_test.go +++ b/docker/moby-17.05.0-ce/cli/compose/convert/volume_test.go @@ -30,7 +30,7 @@ func TestConvertVolumeToMountConflictingOptionsBind(t *testing.T) { Source: "foo", Target: "/target", Bind: &composetypes.ServiceVolumeBind{ - Propagation: "slave", + Propagation: "subordinate", }, } _, err := convertVolumeToMount(config, volumes{}, namespace) diff --git a/docker/moby-17.05.0-ce/cli/compose/loader/volume_test.go b/docker/moby-17.05.0-ce/cli/compose/loader/volume_test.go index 19d19f2..bd6fc3c 100755 --- a/docker/moby-17.05.0-ce/cli/compose/loader/volume_test.go +++ b/docker/moby-17.05.0-ce/cli/compose/loader/volume_test.go @@ -78,12 +78,12 @@ func TestParseVolumeRelativeBindMountWindows(t *testing.T) { } func TestParseVolumeWithBindOptions(t *testing.T) { - volume, err := parseVolume("/source:/target:slave") + volume, err := parseVolume("/source:/target:subordinate") expected := types.ServiceVolumeConfig{ Type: "bind", Source: "/source", Target: "/target", - Bind: &types.ServiceVolumeBind{Propagation: "slave"}, + Bind: &types.ServiceVolumeBind{Propagation: "subordinate"}, } assert.NilError(t, err) assert.DeepEqual(t, volume, expected) diff --git a/docker/moby-17.05.0-ce/daemon/create.go b/docker/moby-17.05.0-ce/daemon/create.go index 707c68a..5397557 100755 --- a/docker/moby-17.05.0-ce/daemon/create.go +++ b/docker/moby-17.05.0-ce/daemon/create.go @@ -41,7 +41,7 @@ func (daemon *Daemon) ContainerCreate(params types.ContainerCreateConfig) (conta } /* -root@fd-mesos-master04.gz01:/var/lib/docker/containers/9be24974a6a7cf064f4a238f70260b13b15359248b3267602bfc49e00f13d670$ ls +root@fd-mesos-main04.gz01:/var/lib/docker/containers/9be24974a6a7cf064f4a238f70260b13b15359248b3267602bfc49e00f13d670$ ls 9be24974a6a7cf064f4a238f70260b13b15359248b3267602bfc49e00f13d670-json.log checkpoints config.v2.json hostconfig.json hostname hosts resolv.conf resolv.conf.hash shm 这些配置文件包含了9be24974a6a7cf064f4a238f70260b13b15359248b3267602bfc49e00f13d670这个容器的所有元数据 diff --git a/docker/moby-17.05.0-ce/daemon/graphdriver/devmapper/deviceset.go b/docker/moby-17.05.0-ce/daemon/graphdriver/devmapper/deviceset.go index cf543c4..1944666 100755 --- a/docker/moby-17.05.0-ce/daemon/graphdriver/devmapper/deviceset.go +++ b/docker/moby-17.05.0-ce/daemon/graphdriver/devmapper/deviceset.go @@ -75,9 +75,9 @@ type transaction struct { } /* -root@fd-xxx-slave38.gz01:/var/lib/docker/devicemapper/metadata$ cat 73566c5a5e7f6cb18378dac0f4f0415b9d982f4231418fc2321de9395d386ab2-init +root@fd-xxx-subordinate38.gz01:/var/lib/docker/devicemapper/metadata$ cat 73566c5a5e7f6cb18378dac0f4f0415b9d982f4231418fc2321de9395d386ab2-init {"device_id":39,"size":42949672960,"transaction_id":61,"initialized":false,"deleted":false} -root@fd-mesos-slave38.gz01:/var/lib/docker/devicemapper/metadata$ +root@fd-mesos-subordinate38.gz01:/var/lib/docker/devicemapper/metadata$ */ // /var/lib/docker/devicemapper/metadata 文件夹中的json文件内容反序列号后存入devInfo结构的各个变量中,赋值初始化见 loadMetadata // DeviceSet:thin pool数据结构 DevInfo:thin device数据结构 @@ -1878,7 +1878,7 @@ func (devices *DeviceSet) initDevmapper(doInit bool) error { // - If is defined, use that file inside the device as a loopback image. Otherwise use the device itself. /* - root@ob-slave-465.gz01:/var/lib/docker/devicemapper$ stat /var/lib/docker/devicemapper/ + root@ob-subordinate-465.gz01:/var/lib/docker/devicemapper$ stat /var/lib/docker/devicemapper/ File: '/var/lib/docker/devicemapper/' Size: 4096 Blocks: 8 IO Block: 4096 directory Device: 804h/2052d Inode: 1184401 Links: 4 @@ -1916,7 +1916,7 @@ func (devices *DeviceSet) initDevmapper(doInit bool) error { // If the pool doesn't exist, create it //dockerd -D -s devicemapper,并且不要配置/etc/docker/daemon.json的时候会走到这个流程 /* - root@ob-slave-465.gz01:/home/odin/yangyazhou$ cat /etc/docker/daemon.json + root@ob-subordinate-465.gz01:/home/odin/yangyazhou$ cat /etc/docker/daemon.json { "storage-driver": "devicemapper", "storage-opts": [ diff --git a/docker/moby-17.05.0-ce/daemon/inspect.go b/docker/moby-17.05.0-ce/daemon/inspect.go index 0685822..8bcf51d 100755 --- a/docker/moby-17.05.0-ce/daemon/inspect.go +++ b/docker/moby-17.05.0-ce/daemon/inspect.go @@ -89,7 +89,7 @@ func (daemon *Daemon) ContainerInspectCurrent(name string, size bool) (*types.Co }, nil } -// containerInspect120 serializes the master version of a container into a json type. +// containerInspect120 serializes the main version of a container into a json type. func (daemon *Daemon) containerInspect120(name string) (*v1p20.ContainerJSON, error) { container, err := daemon.GetContainer(name) if err != nil { diff --git a/docker/moby-17.05.0-ce/daemon/oci_linux.go b/docker/moby-17.05.0-ce/daemon/oci_linux.go index 0b608c3..cf12467 100755 --- a/docker/moby-17.05.0-ce/daemon/oci_linux.go +++ b/docker/moby-17.05.0-ce/daemon/oci_linux.go @@ -428,10 +428,10 @@ func ensureShared(path string) error { return nil } -// Ensure mount point on which path is mounted, is either shared or slave. -func ensureSharedOrSlave(path string) error { +// Ensure mount point on which path is mounted, is either shared or subordinate. +func ensureSharedOrSubordinate(path string) error { sharedMount := false - slaveMount := false + subordinateMount := false sourceMount, optionalOpts, err := getSourceMount(path) if err != nil { @@ -443,14 +443,14 @@ func ensureSharedOrSlave(path string) error { if strings.HasPrefix(opt, "shared:") { sharedMount = true break - } else if strings.HasPrefix(opt, "master:") { - slaveMount = true + } else if strings.HasPrefix(opt, "main:") { + subordinateMount = true break } } - if !sharedMount && !slaveMount { - return fmt.Errorf("Path %s is mounted on %s but it is not a shared or slave mount.", path, sourceMount) + if !sharedMount && !subordinateMount { + return fmt.Errorf("Path %s is mounted on %s but it is not a shared or subordinate mount.", path, sourceMount) } return nil } @@ -461,8 +461,8 @@ var ( "rprivate": mount.RPRIVATE, "shared": mount.SHARED, "rshared": mount.RSHARED, - "slave": mount.SLAVE, - "rslave": mount.RSLAVE, + "subordinate": mount.SLAVE, + "rsubordinate": mount.RSLAVE, } mountPropagationReverseMap = map[int]string{ @@ -470,8 +470,8 @@ var ( mount.RPRIVATE: "rprivate", mount.SHARED: "shared", mount.RSHARED: "rshared", - mount.SLAVE: "slave", - mount.RSLAVE: "rslave", + mount.SLAVE: "subordinate", + mount.RSLAVE: "rsubordinate", } ) @@ -521,9 +521,9 @@ func setMounts(daemon *Daemon, s *specs.Spec, c *container.Container, mounts []c // Determine property of RootPropagation based on volume // properties. If a volume is shared, then keep root propagation - // shared. This should work for slave and private volumes too. + // shared. This should work for subordinate and private volumes too. // - // For slave volumes, it can be either [r]shared/[r]slave. + // For subordinate volumes, it can be either [r]shared/[r]subordinate. // // For private volumes any root propagation value should work. pFlag := mountPropagationMap[m.Propagation] @@ -536,7 +536,7 @@ func setMounts(daemon *Daemon, s *specs.Spec, c *container.Container, mounts []c s.Linux.RootfsPropagation = mountPropagationReverseMap[mount.SHARED] } } else if pFlag == mount.SLAVE || pFlag == mount.RSLAVE { - if err := ensureSharedOrSlave(m.Source); err != nil { + if err := ensureSharedOrSubordinate(m.Source); err != nil { return err } rootpg := mountPropagationMap[s.Linux.RootfsPropagation] diff --git a/docker/moby-17.05.0-ce/distribution/xfer/transfer.go b/docker/moby-17.05.0-ce/distribution/xfer/transfer.go index 20ff7f1..44a6b39 100755 --- a/docker/moby-17.05.0-ce/distribution/xfer/transfer.go +++ b/docker/moby-17.05.0-ce/distribution/xfer/transfer.go @@ -43,7 +43,7 @@ type Transfer interface { Close() Done() <-chan struct{} Released() <-chan struct{} - Broadcast(masterProgressChan <-chan progress.Progress) + Broadcast(mainProgressChan <-chan progress.Progress) } type transfer struct { @@ -67,7 +67,7 @@ type transfer struct { // the transfer is no longer tracked by the transfer manager. released chan struct{} - // broadcastDone is true if the master progress channel has closed. + // broadcastDone is true if the main progress channel has closed. broadcastDone bool // closed is true if Close has been called closed bool @@ -96,14 +96,14 @@ func NewTransfer() Transfer { } // Broadcast copies the progress and error output to all viewers. -func (t *transfer) Broadcast(masterProgressChan <-chan progress.Progress) { +func (t *transfer) Broadcast(mainProgressChan <-chan progress.Progress) { for { var ( p progress.Progress ok bool ) select { - case p, ok = <-masterProgressChan: + case p, ok = <-mainProgressChan: default: // We've depleted the channel, so now we can handle // reads on broadcastSyncChan to let detaching watchers @@ -111,7 +111,7 @@ func (t *transfer) Broadcast(masterProgressChan <-chan progress.Progress) { select { case <-t.broadcastSyncChan: continue - case p, ok = <-masterProgressChan: + case p, ok = <-mainProgressChan: } } @@ -356,11 +356,11 @@ func (tm *transferManager) Transfer(key string, xferFunc DoFunc, progressOutput tm.waitingTransfers = append(tm.waitingTransfers, start) } - masterProgressChan := make(chan progress.Progress) + mainProgressChan := make(chan progress.Progress) //(ldm *LayerDownloadManager) makeDownloadFunc - xfer := xferFunc(masterProgressChan, start, inactive) + xfer := xferFunc(mainProgressChan, start, inactive) watcher := xfer.Watch(progressOutput) - go xfer.Broadcast(masterProgressChan) + go xfer.Broadcast(mainProgressChan) tm.transfers[key] = xfer // When the transfer is finished, remove from the map. diff --git a/docker/moby-17.05.0-ce/hack/integration-cli-on-swarm/host/compose.go b/docker/moby-17.05.0-ce/hack/integration-cli-on-swarm/host/compose.go index a92282a..df1b6c9 100755 --- a/docker/moby-17.05.0-ce/hack/integration-cli-on-swarm/host/compose.go +++ b/docker/moby-17.05.0-ce/hack/integration-cli-on-swarm/host/compose.go @@ -32,8 +32,8 @@ services: # The restart condition needs to be any for funker function condition: any - master: - image: "{{.MasterImage}}" + main: + image: "{{.MainImage}}" command: ["-worker-service=worker", "-input=/mnt/input", "-chunks={{.Chunks}}", "-shuffle={{.Shuffle}}", "-rand-seed={{.RandSeed}}"] networks: - net @@ -45,7 +45,7 @@ services: restart_policy: condition: none placement: -# Make sure the master can access the volume +# Make sure the main can access the volume constraints: [node.id == {{.SelfNodeID}}] networks: @@ -59,7 +59,7 @@ volumes: type composeOptions struct { Replicas int Chunks int - MasterImage string + MainImage string WorkerImage string Volume string Shuffle bool diff --git a/docker/moby-17.05.0-ce/hack/integration-cli-on-swarm/host/host.go b/docker/moby-17.05.0-ce/hack/integration-cli-on-swarm/host/host.go index 40f7a1a..5fc1eb2 100755 --- a/docker/moby-17.05.0-ce/hack/integration-cli-on-swarm/host/host.go +++ b/docker/moby-17.05.0-ce/hack/integration-cli-on-swarm/host/host.go @@ -20,7 +20,7 @@ import ( const ( defaultStackName = "integration-cli-on-swarm" defaultVolumeName = "integration-cli-on-swarm" - defaultMasterImageName = "integration-cli-master" + defaultMainImageName = "integration-cli-main" defaultWorkerImageName = "integration-cli-worker" ) @@ -62,7 +62,7 @@ func xmain() (int, error) { logrus.Infof("Removing volume %s", defaultVolumeName) removeVolume(cli, defaultVolumeName) } - if err = ensureImages(cli, []string{defaultWorkerImageName, defaultMasterImageName}); err != nil { + if err = ensureImages(cli, []string{defaultWorkerImageName, defaultMainImageName}); err != nil { return 1, err } workerImageForStack := defaultWorkerImageName @@ -76,7 +76,7 @@ func xmain() (int, error) { compose, err := createCompose("", cli, composeOptions{ Replicas: *replicas, Chunks: *chunks, - MasterImage: defaultMasterImageName, + MainImage: defaultMainImageName, WorkerImage: workerImageForStack, Volume: defaultVolumeName, Shuffle: *shuffle, @@ -95,7 +95,7 @@ func xmain() (int, error) { if err = createVolumeWithData(cli, defaultVolumeName, map[string][]byte{"/input": filters}, - defaultMasterImageName); err != nil { + defaultMainImageName); err != nil { return 1, err } logrus.Infof("Deploying stack %s from %s", defaultStackName, compose) @@ -104,7 +104,7 @@ func xmain() (int, error) { logrus.Infof(" - Stack: %s", defaultStackName) logrus.Infof(" - Volume: %s", defaultVolumeName) logrus.Infof(" - Compose file: %s", compose) - logrus.Infof(" - Master image: %s", defaultMasterImageName) + logrus.Infof(" - Main image: %s", defaultMainImageName) logrus.Infof(" - Worker image: %s", workerImageForStack) }() if err = deployStack(cli, defaultStackName, compose); err != nil { @@ -113,11 +113,11 @@ func xmain() (int, error) { logrus.Infof("The log will be displayed here after some duration."+ "You can watch the live status via `docker service logs %s_worker`", defaultStackName) - masterContainerID, err := waitForMasterUp(cli, defaultStackName) + mainContainerID, err := waitForMainUp(cli, defaultStackName) if err != nil { return 1, err } - rc, err := waitForContainerCompletion(cli, os.Stdout, os.Stderr, masterContainerID) + rc, err := waitForContainerCompletion(cli, os.Stdout, os.Stderr, mainContainerID) if err != nil { return 1, err } @@ -154,25 +154,25 @@ func filtersBytes(optionalFiltersFile string) ([]byte, error) { return b, nil } -func waitForMasterUp(cli *client.Client, stackName string) (string, error) { - // FIXME(AkihiroSuda): it should retry until master is up, rather than pre-sleeping +func waitForMainUp(cli *client.Client, stackName string) (string, error) { + // FIXME(AkihiroSuda): it should retry until main is up, rather than pre-sleeping time.Sleep(10 * time.Second) fil := filters.NewArgs() fil.Add("label", "com.docker.stack.namespace="+stackName) // FIXME(AkihiroSuda): we should not rely on internal service naming convention - fil.Add("label", "com.docker.swarm.service.name="+stackName+"_master") - masters, err := cli.ContainerList(context.Background(), types.ContainerListOptions{ + fil.Add("label", "com.docker.swarm.service.name="+stackName+"_main") + mains, err := cli.ContainerList(context.Background(), types.ContainerListOptions{ All: true, Filters: fil, }) if err != nil { return "", err } - if len(masters) == 0 { - return "", fmt.Errorf("master not running in stack %s?", stackName) + if len(mains) == 0 { + return "", fmt.Errorf("main not running in stack %s?", stackName) } - return masters[0].ID, nil + return mains[0].ID, nil } func waitForContainerCompletion(cli *client.Client, stdout, stderr io.Writer, containerID string) (int64, error) { diff --git a/docker/moby-17.05.0-ce/integration-cli/docker_cli_build_test.go b/docker/moby-17.05.0-ce/integration-cli/docker_cli_build_test.go index b046330..cc97672 100755 --- a/docker/moby-17.05.0-ce/integration-cli/docker_cli_build_test.go +++ b/docker/moby-17.05.0-ce/integration-cli/docker_cli_build_test.go @@ -381,7 +381,7 @@ func (s *DockerSuite) TestBuildCacheAdd(c *check.C) { func (s *DockerSuite) TestBuildLastModified(c *check.C) { // Temporary fix for #30890. TODO @jhowardmsft figure out what - // has changed in the master busybox image. + // has changed in the main busybox image. testRequires(c, DaemonIsLinux) name := "testbuildlastmodified" @@ -3032,7 +3032,7 @@ func (s *DockerSuite) TestBuildFromGitWithContext(c *check.C) { }, true) defer git.Close() - buildImageSuccessfully(c, name, build.WithContextPath(fmt.Sprintf("%s#master:docker", git.RepoURL))) + buildImageSuccessfully(c, name, build.WithContextPath(fmt.Sprintf("%s#main:docker", git.RepoURL))) res := inspectField(c, name, "Author") if res != "docker" { diff --git a/docker/moby-17.05.0-ce/integration-cli/docker_cli_run_test.go b/docker/moby-17.05.0-ce/integration-cli/docker_cli_run_test.go index e903e1a..2ebddec 100755 --- a/docker/moby-17.05.0-ce/integration-cli/docker_cli_run_test.go +++ b/docker/moby-17.05.0-ce/integration-cli/docker_cli_run_test.go @@ -3917,7 +3917,7 @@ func (s *DockerSuite) TestRunVolumesMountedAsShared(c *check.C) { mount.Unmount(path.Join(tmpDir, "mnt1")) } -func (s *DockerSuite) TestRunVolumesMountedAsSlave(c *check.C) { +func (s *DockerSuite) TestRunVolumesMountedAsSubordinate(c *check.C) { // Volume propagation is linux only. Also it creates directories for // bind mounting, so needs to be same host. testRequires(c, DaemonIsLinux, SameHostDaemon, NotUserNamespace) @@ -3941,7 +3941,7 @@ func (s *DockerSuite) TestRunVolumesMountedAsSlave(c *check.C) { } defer os.RemoveAll(tmpDir2) - if err := ioutil.WriteFile(path.Join(tmpDir2, "slave-testfile"), []byte("Test"), 0644); err != nil { + if err := ioutil.WriteFile(path.Join(tmpDir2, "subordinate-testfile"), []byte("Test"), 0644); err != nil { c.Fatal(err) } @@ -3950,19 +3950,19 @@ func (s *DockerSuite) TestRunVolumesMountedAsSlave(c *check.C) { icmd.RunCommand("mount", "--bind", tmpDir, tmpDir).Assert(c, icmd.Success) icmd.RunCommand("mount", "--make-private", "--make-shared", tmpDir).Assert(c, icmd.Success) - dockerCmd(c, "run", "-i", "-d", "--name", "parent", "-v", fmt.Sprintf("%s:/volume-dest:slave", tmpDir), "busybox", "top") + dockerCmd(c, "run", "-i", "-d", "--name", "parent", "-v", fmt.Sprintf("%s:/volume-dest:subordinate", tmpDir), "busybox", "top") // Bind mount tmpDir2/ onto tmpDir/mnt1. If mount propagates inside - // container then contents of tmpDir2/slave-testfile should become - // visible at "/volume-dest/mnt1/slave-testfile" + // container then contents of tmpDir2/subordinate-testfile should become + // visible at "/volume-dest/mnt1/subordinate-testfile" icmd.RunCommand("mount", "--bind", tmpDir2, path.Join(tmpDir, "mnt1")).Assert(c, icmd.Success) - out, _ := dockerCmd(c, "exec", "parent", "cat", "/volume-dest/mnt1/slave-testfile") + out, _ := dockerCmd(c, "exec", "parent", "cat", "/volume-dest/mnt1/subordinate-testfile") mount.Unmount(path.Join(tmpDir, "mnt1")) if out != "Test" { - c.Fatalf("Bind mount under slave volume did not propagate to container") + c.Fatalf("Bind mount under subordinate volume did not propagate to container") } } diff --git a/docker/moby-17.05.0-ce/integration-cli/docker_experimental_network_test.go b/docker/moby-17.05.0-ce/integration-cli/docker_experimental_network_test.go index 1240392..bbc743d 100755 --- a/docker/moby-17.05.0-ce/integration-cli/docker_experimental_network_test.go +++ b/docker/moby-17.05.0-ce/integration-cli/docker_experimental_network_test.go @@ -38,10 +38,10 @@ func (s *DockerNetworkSuite) TestDockerNetworkMacvlanPersistance(c *check.C) { // verify the driver automatically provisions the 802.1q link (dm-dummy0.60) testRequires(c, DaemonIsLinux, macvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon) - // master dummy interface 'dm' abbreviation represents 'docker macvlan' - master := "dm-dummy0" - // simulate the master link the vlan tagged subinterface parent link will use - createMasterDummy(c, master) + // main dummy interface 'dm' abbreviation represents 'docker macvlan' + main := "dm-dummy0" + // simulate the main link the vlan tagged subinterface parent link will use + createMainDummy(c, main) // create a network specifying the desired sub-interface name dockerCmd(c, "network", "create", "--driver=macvlan", "-o", "parent=dm-dummy0.60", "dm-persist") assertNwIsAvailable(c, "dm-persist") @@ -49,17 +49,17 @@ func (s *DockerNetworkSuite) TestDockerNetworkMacvlanPersistance(c *check.C) { s.d.Restart(c) // verify network is recreated from persistence assertNwIsAvailable(c, "dm-persist") - // cleanup the master interface that also collects the slave dev + // cleanup the main interface that also collects the subordinate dev deleteInterface(c, "dm-dummy0") } func (s *DockerNetworkSuite) TestDockerNetworkIpvlanPersistance(c *check.C) { // verify the driver automatically provisions the 802.1q link (di-dummy0.70) testRequires(c, DaemonIsLinux, ipvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon) - // master dummy interface 'di' notation represent 'docker ipvlan' - master := "di-dummy0" - // simulate the master link the vlan tagged subinterface parent link will use - createMasterDummy(c, master) + // main dummy interface 'di' notation represent 'docker ipvlan' + main := "di-dummy0" + // simulate the main link the vlan tagged subinterface parent link will use + createMainDummy(c, main) // create a network specifying the desired sub-interface name dockerCmd(c, "network", "create", "--driver=ipvlan", "-o", "parent=di-dummy0.70", "di-persist") assertNwIsAvailable(c, "di-persist") @@ -67,45 +67,45 @@ func (s *DockerNetworkSuite) TestDockerNetworkIpvlanPersistance(c *check.C) { s.d.Restart(c) // verify network is recreated from persistence assertNwIsAvailable(c, "di-persist") - // cleanup the master interface that also collects the slave dev + // cleanup the main interface that also collects the subordinate dev deleteInterface(c, "di-dummy0") } func (s *DockerNetworkSuite) TestDockerNetworkMacvlanSubIntCreate(c *check.C) { // verify the driver automatically provisions the 802.1q link (dm-dummy0.50) testRequires(c, DaemonIsLinux, macvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon) - // master dummy interface 'dm' abbreviation represents 'docker macvlan' - master := "dm-dummy0" - // simulate the master link the vlan tagged subinterface parent link will use - createMasterDummy(c, master) + // main dummy interface 'dm' abbreviation represents 'docker macvlan' + main := "dm-dummy0" + // simulate the main link the vlan tagged subinterface parent link will use + createMainDummy(c, main) // create a network specifying the desired sub-interface name dockerCmd(c, "network", "create", "--driver=macvlan", "-o", "parent=dm-dummy0.50", "dm-subinterface") assertNwIsAvailable(c, "dm-subinterface") - // cleanup the master interface which also collects the slave dev + // cleanup the main interface which also collects the subordinate dev deleteInterface(c, "dm-dummy0") } func (s *DockerNetworkSuite) TestDockerNetworkIpvlanSubIntCreate(c *check.C) { // verify the driver automatically provisions the 802.1q link (di-dummy0.50) testRequires(c, DaemonIsLinux, ipvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon) - // master dummy interface 'dm' abbreviation represents 'docker ipvlan' - master := "di-dummy0" - // simulate the master link the vlan tagged subinterface parent link will use - createMasterDummy(c, master) + // main dummy interface 'dm' abbreviation represents 'docker ipvlan' + main := "di-dummy0" + // simulate the main link the vlan tagged subinterface parent link will use + createMainDummy(c, main) // create a network specifying the desired sub-interface name dockerCmd(c, "network", "create", "--driver=ipvlan", "-o", "parent=di-dummy0.60", "di-subinterface") assertNwIsAvailable(c, "di-subinterface") - // cleanup the master interface which also collects the slave dev + // cleanup the main interface which also collects the subordinate dev deleteInterface(c, "di-dummy0") } func (s *DockerNetworkSuite) TestDockerNetworkMacvlanOverlapParent(c *check.C) { // verify the same parent interface cannot be used if already in use by an existing network testRequires(c, DaemonIsLinux, macvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon) - // master dummy interface 'dm' abbreviation represents 'docker macvlan' - master := "dm-dummy0" - createMasterDummy(c, master) - createVlanInterface(c, master, "dm-dummy0.40", "40") + // main dummy interface 'dm' abbreviation represents 'docker macvlan' + main := "dm-dummy0" + createMainDummy(c, main) + createVlanInterface(c, main, "dm-dummy0.40", "40") // create a network using an existing parent interface dockerCmd(c, "network", "create", "--driver=macvlan", "-o", "parent=dm-dummy0.40", "dm-subinterface") assertNwIsAvailable(c, "dm-subinterface") @@ -113,17 +113,17 @@ func (s *DockerNetworkSuite) TestDockerNetworkMacvlanOverlapParent(c *check.C) { out, _, err := dockerCmdWithError("network", "create", "--driver=macvlan", "-o", "parent=dm-dummy0.40", "dm-parent-net-overlap") // verify that the overlap returns an error c.Assert(err, check.NotNil, check.Commentf(out)) - // cleanup the master interface which also collects the slave dev + // cleanup the main interface which also collects the subordinate dev deleteInterface(c, "dm-dummy0") } func (s *DockerNetworkSuite) TestDockerNetworkIpvlanOverlapParent(c *check.C) { // verify the same parent interface cannot be used if already in use by an existing network testRequires(c, DaemonIsLinux, ipvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon) - // master dummy interface 'dm' abbreviation represents 'docker ipvlan' - master := "di-dummy0" - createMasterDummy(c, master) - createVlanInterface(c, master, "di-dummy0.30", "30") + // main dummy interface 'dm' abbreviation represents 'docker ipvlan' + main := "di-dummy0" + createMainDummy(c, main) + createVlanInterface(c, main, "di-dummy0.30", "30") // create a network using an existing parent interface dockerCmd(c, "network", "create", "--driver=ipvlan", "-o", "parent=di-dummy0.30", "di-subinterface") assertNwIsAvailable(c, "di-subinterface") @@ -131,7 +131,7 @@ func (s *DockerNetworkSuite) TestDockerNetworkIpvlanOverlapParent(c *check.C) { out, _, err := dockerCmdWithError("network", "create", "--driver=ipvlan", "-o", "parent=di-dummy0.30", "di-parent-net-overlap") // verify that the overlap returns an error c.Assert(err, check.NotNil, check.Commentf(out)) - // cleanup the master interface which also collects the slave dev + // cleanup the main interface which also collects the subordinate dev deleteInterface(c, "di-dummy0") } @@ -470,8 +470,8 @@ func (s *DockerSuite) TestDockerNetworkMacVlanExistingParent(c *check.C) { // macvlan bridge mode - empty parent interface containers can reach each other internally but not externally testRequires(c, DaemonIsLinux, macvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon) netName := "dm-parent-exists" - createMasterDummy(c, "dm-dummy0") - //out, err := createVlanInterface(c, "dm-parent", "dm-slave", "macvlan", "bridge") + createMainDummy(c, "dm-dummy0") + //out, err := createVlanInterface(c, "dm-parent", "dm-subordinate", "macvlan", "bridge") // create a network using an existing parent interface dockerCmd(c, "network", "create", "--driver=macvlan", "-o", "parent=dm-dummy0", netName) assertNwIsAvailable(c, netName) @@ -487,7 +487,7 @@ func (s *DockerSuite) TestDockerNetworkMacVlanSubinterface(c *check.C) { // macvlan bridge mode - empty parent interface containers can reach each other internally but not externally testRequires(c, DaemonIsLinux, macvlanKernelSupport, NotUserNamespace, NotArm, ExperimentalDaemon) netName := "dm-subinterface" - createMasterDummy(c, "dm-dummy0") + createMainDummy(c, "dm-dummy0") createVlanInterface(c, "dm-dummy0", "dm-dummy0.20", "20") // create a network using an existing parent interface dockerCmd(c, "network", "create", "--driver=macvlan", "-o", "parent=dm-dummy0.20", netName) @@ -510,24 +510,24 @@ func (s *DockerSuite) TestDockerNetworkMacVlanSubinterface(c *check.C) { assertNwNotAvailable(c, netName) // verify the network delete did not delete the predefined sub-interface linkExists(c, "dm-dummy0.20") - // delete the parent interface which also collects the slave + // delete the parent interface which also collects the subordinate deleteInterface(c, "dm-dummy0") } -func createMasterDummy(c *check.C, master string) { +func createMainDummy(c *check.C, main string) { // ip link add type dummy - icmd.RunCommand("ip", "link", "add", master, "type", "dummy").Assert(c, icmd.Success) - icmd.RunCommand("ip", "link", "set", master, "up").Assert(c, icmd.Success) + icmd.RunCommand("ip", "link", "add", main, "type", "dummy").Assert(c, icmd.Success) + icmd.RunCommand("ip", "link", "set", main, "up").Assert(c, icmd.Success) } -func createVlanInterface(c *check.C, master, slave, id string) { - // ip link add link name . type vlan id - icmd.RunCommand("ip", "link", "add", "link", master, "name", slave, "type", "vlan", "id", id).Assert(c, icmd.Success) +func createVlanInterface(c *check.C, main, subordinate, id string) { + // ip link add link
name
. type vlan id + icmd.RunCommand("ip", "link", "add", "link", main, "name", subordinate, "type", "vlan", "id", id).Assert(c, icmd.Success) // ip link set up - icmd.RunCommand("ip", "link", "set", slave, "up").Assert(c, icmd.Success) + icmd.RunCommand("ip", "link", "set", subordinate, "up").Assert(c, icmd.Success) } -func linkExists(c *check.C, master string) { +func linkExists(c *check.C, main string) { // verify the specified link exists, ip link show - icmd.RunCommand("ip", "link", "show", master).Assert(c, icmd.Success) + icmd.RunCommand("ip", "link", "show", main).Assert(c, icmd.Success) } diff --git a/docker/moby-17.05.0-ce/layer/layer.go b/docker/moby-17.05.0-ce/layer/layer.go index 6acb752..e66c4ab 100755 --- a/docker/moby-17.05.0-ce/layer/layer.go +++ b/docker/moby-17.05.0-ce/layer/layer.go @@ -87,25 +87,25 @@ chainID计算过程:假设某个镜像diff_ids如下 cat /var/lib/docker/imag #2的chainID计算方法:(父层的chainID(第一层chainID)和第二层的diff_id计算sha256sum的结果) root@fd-mesos-xxx.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ echo -n "sha256:51a45fddc531d0138a18ad6f073310daab3a3fe4862997b51b6c8571f3776b62 sha256:5792d8202a821076989a52ced68d1382fc0596f937e7808abbd5ffc1db93fffb" | sha256sum e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445 - - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445/diff + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445/diff sha256:5792d8202a821076989a52ced68d1382fc0596f937e7808abbd5ffc1db93fffb //diff内容就和diff_ids第二层一样 - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445/parent + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445/parent sha256:51a45fddc531d0138a18ad6f073310daab3a3fe4862997b51b6c8571f3776b62 //parent内容就是第一层chainID - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ #3的chainID计算方法:(父层的chainID(第二层chainID)和第三层的diff_id计算sha256sum的结果) root@fd-mesos-xxx.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ echo -n "sha256:e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445 sha256:b7bbef1946d74cdfd84b0db815b4fe9fc9405451190aa65b9eab6ae198c560b4" | sha256sum c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8 - - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ ls c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8/ + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ ls c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8/ cache-id diff parent size tar-split.json.gz - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8/parent + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8/parent sha256:e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445 //parent内容就是第二层chainID - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8/diff + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8/diff sha256:b7bbef1946d74cdfd84b0db815b4fe9fc9405451190aa65b9eab6ae198c560b4 //diff内容就和diff_ids第二层一样 - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ */ //ChainID 通过 createChainIDFromParent 计算得到,根据/var/lib/docker/image/devicemapper/imagedb/content/sha256/XXX文件内容中的diff_ids递归计算得到, @@ -355,25 +355,25 @@ chainID计算过程:假设某个镜像diff_ids如下 cat /var/lib/docker/imag #2的chainID计算方法:(父层的chainID(第一层chainID)和第二层的diff_id计算sha256sum的结果) root@fd-mesos-xxx.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ echo -n "sha256:51a45fddc531d0138a18ad6f073310daab3a3fe4862997b51b6c8571f3776b62 sha256:5792d8202a821076989a52ced68d1382fc0596f937e7808abbd5ffc1db93fffb" | sha256sum e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445 - - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445/diff + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445/diff sha256:5792d8202a821076989a52ced68d1382fc0596f937e7808abbd5ffc1db93fffb //diff内容就和diff_ids第二层一样 - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445/parent + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445/parent sha256:51a45fddc531d0138a18ad6f073310daab3a3fe4862997b51b6c8571f3776b62 //parent内容就是第一层chainID - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ #3的chainID计算方法:(父层的chainID(第二层chainID)和第三层的diff_id计算sha256sum的结果) root@fd-mesos-xxx.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ echo -n "sha256:e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445 sha256:b7bbef1946d74cdfd84b0db815b4fe9fc9405451190aa65b9eab6ae198c560b4" | sha256sum c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8 - - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ ls c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8/ + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ ls c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8/ cache-id diff parent size tar-split.json.gz - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8/parent + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8/parent sha256:e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445 //parent内容就是第二层chainID - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8/diff + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8/diff sha256:b7bbef1946d74cdfd84b0db815b4fe9fc9405451190aa65b9eab6ae198c560b4 //diff内容就和diff_ids第二层一样 - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ */ //根据parent 和 dgsts 算出一个ChainID 参考https://segmentfault.com/a/1190000009730986 //这里是算出最顶层的 b7bbef1946d74cdfd84b0db815b4fe9fc9405451190aa65b9eab6ae198c560b4 diff_id对应的chainID对应,也就是上面的#3的chainID diff --git a/docker/moby-17.05.0-ce/layer/ro_layer.go b/docker/moby-17.05.0-ce/layer/ro_layer.go index 04b725d..95104ac 100755 --- a/docker/moby-17.05.0-ce/layer/ro_layer.go +++ b/docker/moby-17.05.0-ce/layer/ro_layer.go @@ -70,25 +70,25 @@ chainID计算过程:假设某个镜像diff_ids如下 cat /var/lib/docker/imag #2的chainID计算方法:(父层的chainID(第一层chainID)和第二层的diff_id计算sha256sum的结果) root@fd-mesos-xxx.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ echo -n "sha256:51a45fddc531d0138a18ad6f073310daab3a3fe4862997b51b6c8571f3776b62 sha256:5792d8202a821076989a52ced68d1382fc0596f937e7808abbd5ffc1db93fffb" | sha256sum e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445 - - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445/diff + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445/diff sha256:5792d8202a821076989a52ced68d1382fc0596f937e7808abbd5ffc1db93fffb //diff内容就和diff_ids第二层一样 - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445/parent + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445/parent sha256:51a45fddc531d0138a18ad6f073310daab3a3fe4862997b51b6c8571f3776b62 //parent内容就是第一层chainID - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ #3的chainID计算方法:(父层的chainID(第二层chainID)和第三层的diff_id计算sha256sum的结果) root@fd-mesos-xxx.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ echo -n "sha256:e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445 sha256:b7bbef1946d74cdfd84b0db815b4fe9fc9405451190aa65b9eab6ae198c560b4" | sha256sum c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8 - - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ ls c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8/ + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ ls c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8/ cache-id diff parent size tar-split.json.gz - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8/parent + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8/parent sha256:e299130128d155d60bac3991100c2cda6a35c5ad0b542a5ffab2679654dfd445 //parent内容就是第二层chainID - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8/diff + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ cat c6c38436b063046117fb9b4210a54c0d29aa8b5f350964d1723468e6a324e1a8/diff sha256:b7bbef1946d74cdfd84b0db815b4fe9fc9405451190aa65b9eab6ae198c560b4 //diff内容就和diff_ids第二层一样 - root@fd-mesos-master04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ + root@fd-mesos-main04.gz01:/var/lib/docker/image/devicemapper/layerdb/sha256$ */ chainID ChainID //chainID和parent可以从所属image元数据计算出来 // /var/lib/docker/image/devicemapper/layerdb/sha256/$chainID/diff内容也就是/var/lib/docker/image/devicemapper/imagedb/content/sha256/$image中的diff_ids对应的层 diff --git a/docker/moby-17.05.0-ce/libcontainerd/process_unix.go b/docker/moby-17.05.0-ce/libcontainerd/process_unix.go index 78d01ed..c377fab 100755 --- a/docker/moby-17.05.0-ce/libcontainerd/process_unix.go +++ b/docker/moby-17.05.0-ce/libcontainerd/process_unix.go @@ -17,7 +17,7 @@ import ( ) /* -root@fd-mesos-slave50.gz01:/var/run/docker/libcontainerd/246d243260dc647eb174421c05b88567a0f0d64f451cbc17fde53d24cc6af340$ ls +root@fd-mesos-subordinate50.gz01:/var/run/docker/libcontainerd/246d243260dc647eb174421c05b88567a0f0d64f451cbc17fde53d24cc6af340$ ls config.json init-stdin init-stdout io相关的命名管道,用来和容器之间进行通信,比如这里的init-stdin文件用来向容器的stdin中写数据,init-stdout用来接收容器的stdout输出 上面只有init-stdin和init-stdout,没有init-stderr,那是因为我们创建容器的时候指定了-t参数,意思是让docker为容器创建一个tty(虚拟的), diff --git a/docker/moby-17.05.0-ce/pkg/devicemapper/devmapper_wrapper.go b/docker/moby-17.05.0-ce/pkg/devicemapper/devmapper_wrapper.go index 14b8b2e..56ee0b5 100755 --- a/docker/moby-17.05.0-ce/pkg/devicemapper/devmapper_wrapper.go +++ b/docker/moby-17.05.0-ce/pkg/devicemapper/devmapper_wrapper.go @@ -23,7 +23,7 @@ vgremove docker pvremove /dev/sdm1 rm -rf /var/lib/docker/* 删除后需要加上这个 - 如果root@ob-slave-465.gz01:~/yyz/docker/bundles/17.05.0-ce/binary-daemon$ lvremove docker-yyz + 如果root@ob-subordinate-465.gz01:~/yyz/docker/bundles/17.05.0-ce/binary-daemon$ lvremove docker-yyz Logical volume docker-yyz/thinpool is used by another device. 处理方法:dmsetup ls; dmsetup remove docker-xxx这个docker设备,参考https://forum.proxmox.com/threads/lvremove-logical-volume-is-used-by-another-device.33768/ diff --git a/docker/moby-17.05.0-ce/pkg/gitutils/gitutils_test.go b/docker/moby-17.05.0-ce/pkg/gitutils/gitutils_test.go index d197058..c692d14 100755 --- a/docker/moby-17.05.0-ce/pkg/gitutils/gitutils_test.go +++ b/docker/moby-17.05.0-ce/pkg/gitutils/gitutils_test.go @@ -163,7 +163,7 @@ func TestCheckoutGit(t *testing.T) { t.Fatal(err) } - if _, err = gitWithinDir(gitDir, "checkout", "master"); err != nil { + if _, err = gitWithinDir(gitDir, "checkout", "main"); err != nil { t.Fatal(err) } @@ -175,13 +175,13 @@ func TestCheckoutGit(t *testing.T) { cases := []singleCase{ {"", "FROM scratch", false}, - {"master", "FROM scratch", false}, + {"main", "FROM scratch", false}, {":subdir", "FROM scratch" + eol + "EXPOSE 5000", false}, {":nosubdir", "", true}, // missing directory error {":Dockerfile", "", true}, // not a directory error - {"master:nosubdir", "", true}, - {"master:subdir", "FROM scratch" + eol + "EXPOSE 5000", false}, - {"master:../subdir", "", true}, + {"main:nosubdir", "", true}, + {"main:subdir", "FROM scratch" + eol + "EXPOSE 5000", false}, + {"main:../subdir", "", true}, {"test", "FROM scratch" + eol + "EXPOSE 3000", false}, {"test:", "FROM scratch" + eol + "EXPOSE 3000", false}, {"test:subdir", "FROM busybox" + eol + "EXPOSE 5000", false}, @@ -193,8 +193,8 @@ func TestCheckoutGit(t *testing.T) { // error: readlink("absolutelink"): Function not implemented // error: unable to index file absolutelink // fatal: adding files failed - cases = append(cases, singleCase{frag: "master:absolutelink", exp: "FROM scratch" + eol + "EXPOSE 5000", fail: false}) - cases = append(cases, singleCase{frag: "master:parentlink", exp: "FROM scratch" + eol + "EXPOSE 5000", fail: false}) + cases = append(cases, singleCase{frag: "main:absolutelink", exp: "FROM scratch" + eol + "EXPOSE 5000", fail: false}) + cases = append(cases, singleCase{frag: "main:parentlink", exp: "FROM scratch" + eol + "EXPOSE 5000", fail: false}) } for _, c := range cases { diff --git a/docker/moby-17.05.0-ce/pkg/mount/flags.go b/docker/moby-17.05.0-ce/pkg/mount/flags.go index 607dbed..33c69a8 100755 --- a/docker/moby-17.05.0-ce/pkg/mount/flags.go +++ b/docker/moby-17.05.0-ce/pkg/mount/flags.go @@ -36,8 +36,8 @@ var flags = map[string]struct { "rprivate": {false, RPRIVATE}, "shared": {false, SHARED}, "rshared": {false, RSHARED}, - "slave": {false, SLAVE}, - "rslave": {false, RSLAVE}, + "subordinate": {false, SLAVE}, + "rsubordinate": {false, RSLAVE}, "relatime": {false, RELATIME}, "norelatime": {true, RELATIME}, "strictatime": {false, STRICTATIME}, @@ -64,8 +64,8 @@ var propagationFlags = map[string]bool{ "rprivate": true, "shared": true, "rshared": true, - "slave": true, - "rslave": true, + "subordinate": true, + "rsubordinate": true, } // MergeTmpfsOptions merge mount options to make sure there is no duplicate. diff --git a/docker/moby-17.05.0-ce/pkg/mount/flags_linux.go b/docker/moby-17.05.0-ce/pkg/mount/flags_linux.go index 25f4661..5c204b6 100755 --- a/docker/moby-17.05.0-ce/pkg/mount/flags_linux.go +++ b/docker/moby-17.05.0-ce/pkg/mount/flags_linux.go @@ -60,7 +60,7 @@ const ( // RPRIVATE marks the entire mount tree as PRIVATE. RPRIVATE = syscall.MS_PRIVATE | syscall.MS_REC - // SLAVE creates a mount which receives propagation from its master, but not + // SLAVE creates a mount which receives propagation from its main, but not // vice versa. SLAVE = syscall.MS_SLAVE diff --git a/docker/moby-17.05.0-ce/pkg/mount/mount_unix_test.go b/docker/moby-17.05.0-ce/pkg/mount/mount_unix_test.go index 253aff3..88187be 100755 --- a/docker/moby-17.05.0-ce/pkg/mount/mount_unix_test.go +++ b/docker/moby-17.05.0-ce/pkg/mount/mount_unix_test.go @@ -139,8 +139,8 @@ func TestGetMounts(t *testing.T) { } func TestMergeTmpfsOptions(t *testing.T) { - options := []string{"noatime", "ro", "size=10k", "defaults", "atime", "defaults", "rw", "rprivate", "size=1024k", "slave"} - expected := []string{"atime", "rw", "size=1024k", "slave"} + options := []string{"noatime", "ro", "size=10k", "defaults", "atime", "defaults", "rw", "rprivate", "size=1024k", "subordinate"} + expected := []string{"atime", "rw", "size=1024k", "subordinate"} merged, err := MergeTmpfsOptions(options) if err != nil { t.Fatal(err) @@ -154,7 +154,7 @@ func TestMergeTmpfsOptions(t *testing.T) { } } - options = []string{"noatime", "ro", "size=10k", "atime", "rw", "rprivate", "size=1024k", "slave", "size"} + options = []string{"noatime", "ro", "size=10k", "atime", "rw", "rprivate", "size=1024k", "subordinate", "size"} _, err = MergeTmpfsOptions(options) if err == nil { t.Fatal("Expected error got nil") diff --git a/docker/moby-17.05.0-ce/pkg/mount/mounter_linux_test.go b/docker/moby-17.05.0-ce/pkg/mount/mounter_linux_test.go index 9c74b1f..feb0417 100755 --- a/docker/moby-17.05.0-ce/pkg/mount/mounter_linux_test.go +++ b/docker/moby-17.05.0-ce/pkg/mount/mounter_linux_test.go @@ -50,19 +50,19 @@ func TestMount(t *testing.T) { {source, "", "bind", "", ""}, {source, "", "bind,private", "", ""}, {source, "", "bind,shared", "", "shared"}, - {source, "", "bind,slave", "", "master"}, + {source, "", "bind,subordinate", "", "main"}, {source, "", "bind,unbindable", "", "unbindable"}, // Read Write tests {source, "", "bind,rw", "rw", ""}, {source, "", "bind,rw,private", "rw", ""}, {source, "", "bind,rw,shared", "rw", "shared"}, - {source, "", "bind,rw,slave", "rw", "master"}, + {source, "", "bind,rw,subordinate", "rw", "main"}, {source, "", "bind,rw,unbindable", "rw", "unbindable"}, // Read Only tests {source, "", "bind,ro", "ro", ""}, {source, "", "bind,ro,private", "ro", ""}, {source, "", "bind,ro,shared", "ro", "shared"}, - {source, "", "bind,ro,slave", "ro", "master"}, + {source, "", "bind,ro,subordinate", "ro", "main"}, {source, "", "bind,ro,unbindable", "ro", "unbindable"}, } @@ -76,8 +76,8 @@ func TestMount(t *testing.T) { } t.Run(fmt.Sprintf("%v-%v", ftype, options), func(t *testing.T) { - if strings.Contains(tc.options, "slave") { - // Slave requires a shared source + if strings.Contains(tc.options, "subordinate") { + // Subordinate requires a shared source if err := MakeShared(source); err != nil { t.Fatal(err) } diff --git a/docker/moby-17.05.0-ce/pkg/mount/mountinfo_linux.go b/docker/moby-17.05.0-ce/pkg/mount/mountinfo_linux.go index be69fee..e5feed2 100755 --- a/docker/moby-17.05.0-ce/pkg/mount/mountinfo_linux.go +++ b/docker/moby-17.05.0-ce/pkg/mount/mountinfo_linux.go @@ -11,7 +11,7 @@ import ( ) const ( - /* 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue + /* 36 35 98:0 /mnt1 /mnt2 rw,noatime main:1 - ext3 /dev/root rw,errors=continue (1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11) (1) mount ID: unique identifier of the mount (may be reused after umount) diff --git a/docker/moby-17.05.0-ce/pkg/mount/sharedsubtree_linux.go b/docker/moby-17.05.0-ce/pkg/mount/sharedsubtree_linux.go index 8ceec84..69fe16c 100755 --- a/docker/moby-17.05.0-ce/pkg/mount/sharedsubtree_linux.go +++ b/docker/moby-17.05.0-ce/pkg/mount/sharedsubtree_linux.go @@ -26,16 +26,16 @@ func MakeRPrivate(mountPoint string) error { return ensureMountedAs(mountPoint, "rprivate") } -// MakeSlave ensures a mounted filesystem has the SLAVE mount option enabled. +// MakeSubordinate ensures a mounted filesystem has the SLAVE mount option enabled. // See the supported options in flags.go for further reference. -func MakeSlave(mountPoint string) error { - return ensureMountedAs(mountPoint, "slave") +func MakeSubordinate(mountPoint string) error { + return ensureMountedAs(mountPoint, "subordinate") } -// MakeRSlave ensures a mounted filesystem has the RSLAVE mount option enabled. +// MakeRSubordinate ensures a mounted filesystem has the RSLAVE mount option enabled. // See the supported options in flags.go for further reference. -func MakeRSlave(mountPoint string) error { - return ensureMountedAs(mountPoint, "rslave") +func MakeRSubordinate(mountPoint string) error { + return ensureMountedAs(mountPoint, "rsubordinate") } // MakeUnbindable ensures a mounted filesystem has the UNBINDABLE mount option diff --git a/docker/moby-17.05.0-ce/pkg/mount/sharedsubtree_linux_test.go b/docker/moby-17.05.0-ce/pkg/mount/sharedsubtree_linux_test.go index c183794..db0de5f 100755 --- a/docker/moby-17.05.0-ce/pkg/mount/sharedsubtree_linux_test.go +++ b/docker/moby-17.05.0-ce/pkg/mount/sharedsubtree_linux_test.go @@ -174,9 +174,9 @@ func TestSubtreeShared(t *testing.T) { } } -// testing that mounts to a shared source show up in the slave target, -// and that mounts into a slave target do _not_ show up in the shared source -func TestSubtreeSharedSlave(t *testing.T) { +// testing that mounts to a shared source show up in the subordinate target, +// and that mounts into a subordinate target do _not_ show up in the shared source +func TestSubtreeSharedSubordinate(t *testing.T) { tmp := path.Join(os.TempDir(), "mount-tests") if err := os.MkdirAll(tmp, 0777); err != nil { t.Fatal(err) @@ -237,8 +237,8 @@ func TestSubtreeSharedSlave(t *testing.T) { } }() - // next, make the target slave - if err := MakeSlave(targetDir); err != nil { + // next, make the target subordinate + if err := MakeSubordinate(targetDir); err != nil { t.Fatal(err) } defer func() { diff --git a/docker/moby-17.05.0-ce/pkg/mount/sharedsubtree_solaris.go b/docker/moby-17.05.0-ce/pkg/mount/sharedsubtree_solaris.go index 09f6b03..b98ba42 100755 --- a/docker/moby-17.05.0-ce/pkg/mount/sharedsubtree_solaris.go +++ b/docker/moby-17.05.0-ce/pkg/mount/sharedsubtree_solaris.go @@ -26,16 +26,16 @@ func MakeRPrivate(mountPoint string) error { return ensureMountedAs(mountPoint, "rprivate") } -// MakeSlave ensures a mounted filesystem has the SLAVE mount option enabled. +// MakeSubordinate ensures a mounted filesystem has the SLAVE mount option enabled. // See the supported options in flags.go for further reference. -func MakeSlave(mountPoint string) error { - return ensureMountedAs(mountPoint, "slave") +func MakeSubordinate(mountPoint string) error { + return ensureMountedAs(mountPoint, "subordinate") } -// MakeRSlave ensures a mounted filesystem has the RSLAVE mount option enabled. +// MakeRSubordinate ensures a mounted filesystem has the RSLAVE mount option enabled. // See the supported options in flags.go for further reference. -func MakeRSlave(mountPoint string) error { - return ensureMountedAs(mountPoint, "rslave") +func MakeRSubordinate(mountPoint string) error { + return ensureMountedAs(mountPoint, "rsubordinate") } // MakeUnbindable ensures a mounted filesystem has the UNBINDABLE mount option diff --git a/docker/moby-17.05.0-ce/reference/store_test.go b/docker/moby-17.05.0-ce/reference/store_test.go index 8f0ff63..3b7f954 100755 --- a/docker/moby-17.05.0-ce/reference/store_test.go +++ b/docker/moby-17.05.0-ce/reference/store_test.go @@ -17,13 +17,13 @@ var ( "registry:5000/foobar:HEAD": "sha256:470022b8af682154f57a2163d030eb369549549cba00edc69e1b99b46bb924d6", "registry:5000/foobar:alternate": "sha256:ae300ebc4a4f00693702cfb0a5e0b7bc527b353828dc86ad09fb95c8a681b793", "registry:5000/foobar:latest": "sha256:6153498b9ac00968d71b66cca4eac37e990b5f9eb50c26877eb8799c8847451b", - "registry:5000/foobar:master": "sha256:6c9917af4c4e05001b346421959d7ea81b6dc9d25718466a37a6add865dfd7fc", + "registry:5000/foobar:main": "sha256:6c9917af4c4e05001b346421959d7ea81b6dc9d25718466a37a6add865dfd7fc", "jess/hollywood:latest": "sha256:ae7a5519a0a55a2d4ef20ddcbd5d0ca0888a1f7ab806acc8e2a27baf46f529fe", "registry@sha256:367eb40fd0330a7e464777121e39d2f5b3e8e23a1e159342e53ab05c9e4d94e6": "sha256:24126a56805beb9711be5f4590cc2eb55ab8d4a85ebd618eed72bb19fc50631c", "busybox:latest": "sha256:91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c", } - marshalledSaveLoadTestCases = []byte(`{"Repositories":{"busybox":{"busybox:latest":"sha256:91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c"},"jess/hollywood":{"jess/hollywood:latest":"sha256:ae7a5519a0a55a2d4ef20ddcbd5d0ca0888a1f7ab806acc8e2a27baf46f529fe"},"registry":{"registry@sha256:367eb40fd0330a7e464777121e39d2f5b3e8e23a1e159342e53ab05c9e4d94e6":"sha256:24126a56805beb9711be5f4590cc2eb55ab8d4a85ebd618eed72bb19fc50631c"},"registry:5000/foobar":{"registry:5000/foobar:HEAD":"sha256:470022b8af682154f57a2163d030eb369549549cba00edc69e1b99b46bb924d6","registry:5000/foobar:alternate":"sha256:ae300ebc4a4f00693702cfb0a5e0b7bc527b353828dc86ad09fb95c8a681b793","registry:5000/foobar:latest":"sha256:6153498b9ac00968d71b66cca4eac37e990b5f9eb50c26877eb8799c8847451b","registry:5000/foobar:master":"sha256:6c9917af4c4e05001b346421959d7ea81b6dc9d25718466a37a6add865dfd7fc"}}}`) + marshalledSaveLoadTestCases = []byte(`{"Repositories":{"busybox":{"busybox:latest":"sha256:91e54dfb11794fad694460162bf0cb0a4fa710cfa3f60979c177d920813e267c"},"jess/hollywood":{"jess/hollywood:latest":"sha256:ae7a5519a0a55a2d4ef20ddcbd5d0ca0888a1f7ab806acc8e2a27baf46f529fe"},"registry":{"registry@sha256:367eb40fd0330a7e464777121e39d2f5b3e8e23a1e159342e53ab05c9e4d94e6":"sha256:24126a56805beb9711be5f4590cc2eb55ab8d4a85ebd618eed72bb19fc50631c"},"registry:5000/foobar":{"registry:5000/foobar:HEAD":"sha256:470022b8af682154f57a2163d030eb369549549cba00edc69e1b99b46bb924d6","registry:5000/foobar:alternate":"sha256:ae300ebc4a4f00693702cfb0a5e0b7bc527b353828dc86ad09fb95c8a681b793","registry:5000/foobar:latest":"sha256:6153498b9ac00968d71b66cca4eac37e990b5f9eb50c26877eb8799c8847451b","registry:5000/foobar:main":"sha256:6c9917af4c4e05001b346421959d7ea81b6dc9d25718466a37a6add865dfd7fc"}}}`) ) func TestLoad(t *testing.T) { diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/bridge/bridge.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/bridge/bridge.go index 6b79a03..4f78cf7 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/bridge/bridge.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/bridge/bridge.go @@ -851,7 +851,7 @@ func addToBridge(nlh *netlink.Handle, ifaceName, bridgeName string) error { if err != nil { return fmt.Errorf("could not find interface %s: %v", ifaceName, err) } - if err = nlh.LinkSetMaster(link, + if err = nlh.LinkSetMain(link, &netlink.Bridge{LinkAttrs: netlink.LinkAttrs{Name: bridgeName}}); err != nil { logrus.Debugf("Failed to add %s to bridge via netlink.Trying ioctl: %v", ifaceName, err) iface, err := net.InterfaceByName(ifaceName) @@ -859,12 +859,12 @@ func addToBridge(nlh *netlink.Handle, ifaceName, bridgeName string) error { return fmt.Errorf("could not find network interface %s: %v", ifaceName, err) } - master, err := net.InterfaceByName(bridgeName) + main, err := net.InterfaceByName(bridgeName) if err != nil { return fmt.Errorf("could not find bridge %s: %v", bridgeName, err) } - return ioctlAddToBridge(iface, master) + return ioctlAddToBridge(iface, main) } return nil } diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/bridge/netlink_deprecated_linux.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/bridge/netlink_deprecated_linux.go index 6b49efa..fb3e602 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/bridge/netlink_deprecated_linux.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/bridge/netlink_deprecated_linux.go @@ -48,9 +48,9 @@ func getIfSocket() (fd int, err error) { return -1, err } -func ifIoctBridge(iface, master *net.Interface, op uintptr) error { - if len(master.Name) >= ifNameSize { - return fmt.Errorf("Interface name %s too long", master.Name) +func ifIoctBridge(iface, main *net.Interface, op uintptr) error { + if len(main.Name) >= ifNameSize { + return fmt.Errorf("Interface name %s too long", main.Name) } s, err := getIfSocket() @@ -60,7 +60,7 @@ func ifIoctBridge(iface, master *net.Interface, op uintptr) error { defer syscall.Close(s) ifr := ifreqIndex{} - copy(ifr.IfrnName[:len(ifr.IfrnName)-1], master.Name) + copy(ifr.IfrnName[:len(ifr.IfrnName)-1], main.Name) ifr.IfruIndex = int32(iface.Index) if _, _, err := syscall.Syscall(syscall.SYS_IOCTL, uintptr(s), op, uintptr(unsafe.Pointer(&ifr))); err != 0 { @@ -70,10 +70,10 @@ func ifIoctBridge(iface, master *net.Interface, op uintptr) error { return nil } -// Add a slave to a bridge device. This is more backward-compatible than -// netlink.NetworkSetMaster and works on RHEL 6. -func ioctlAddToBridge(iface, master *net.Interface) error { - return ifIoctBridge(iface, master, ioctlBrAddIf) +// Add a subordinate to a bridge device. This is more backward-compatible than +// netlink.NetworkSetMain and works on RHEL 6. +func ioctlAddToBridge(iface, main *net.Interface) error { + return ifIoctBridge(iface, main, ioctlBrAddIf) } func ioctlSetMacAddress(name, addr string) error { diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/bridge/netlink_deprecated_unsupported.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/bridge/netlink_deprecated_unsupported.go index 7e2d57b..c6e3f4d 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/bridge/netlink_deprecated_unsupported.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/bridge/netlink_deprecated_unsupported.go @@ -7,9 +7,9 @@ import ( "net" ) -// Add a slave to a bridge device. This is more backward-compatible than -// netlink.NetworkSetMaster and works on RHEL 6. -func ioctlAddToBridge(iface, master *net.Interface) error { +// Add a subordinate to a bridge device. This is more backward-compatible than +// netlink.NetworkSetMain and works on RHEL 6. +func ioctlAddToBridge(iface, main *net.Interface) error { return errors.New("not implemented") } diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/ipvlan/ipvlan_network.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/ipvlan/ipvlan_network.go index 801fc20..d59d4cd 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/ipvlan/ipvlan_network.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/ipvlan/ipvlan_network.go @@ -91,7 +91,7 @@ func (d *driver) createNetwork(config *configuration) error { if err != nil { return err } - config.CreatedSlaveLink = true + config.CreatedSubordinateLink = true // notify the user in logs they have limited comunicatins if config.Parent == getDummyName(stringid.TruncateID(config.ID)) { logrus.Debugf("Empty -o parent= and --internal flags limit communications to other containers inside of network: %s", @@ -104,8 +104,8 @@ func (d *driver) createNetwork(config *configuration) error { if err != nil { return err } - // if driver created the networks slave link, record it for future deletion - config.CreatedSlaveLink = true + // if driver created the networks subordinate link, record it for future deletion + config.CreatedSubordinateLink = true } } n := &network{ @@ -127,8 +127,8 @@ func (d *driver) DeleteNetwork(nid string) error { if n == nil { return fmt.Errorf("network id %s not found", nid) } - // if the driver created the slave interface, delete it, otherwise leave it - if ok := n.config.CreatedSlaveLink; ok { + // if the driver created the subordinate interface, delete it, otherwise leave it + if ok := n.config.CreatedSubordinateLink; ok { // if the interface exists, only delete if it matches iface.vlan or dummy.net_id naming if ok := parentExists(n.config.Parent); ok { // only delete the link if it is named the net_id diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/ipvlan/ipvlan_setup.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/ipvlan/ipvlan_setup.go index 75f0821..fdde195 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/ipvlan/ipvlan_setup.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/ipvlan/ipvlan_setup.go @@ -16,7 +16,7 @@ const ( ipvlanMajorVer = 2 // minimum ipvlan major kernel support ) -// createIPVlan Create the ipvlan slave specifying the source name +// createIPVlan Create the ipvlan subordinate specifying the source name func createIPVlan(containerIfName, parent, ipvlanMode string) (string, error) { // Set the ipvlan mode. Default is bridge mode mode, err := setIPVlanMode(ipvlanMode) @@ -27,7 +27,7 @@ func createIPVlan(containerIfName, parent, ipvlanMode string) (string, error) { if !parentExists(parent) { return "", fmt.Errorf("the requested parent interface %s was not found on the Docker host", parent) } - // Get the link for the master index (Example: the docker host eth iface) + // Get the link for the main index (Example: the docker host eth iface) parentLink, err := ns.NlHandle().LinkByName(parent) if err != nil { return "", fmt.Errorf("error occoured looking up the %s parent iface %s error: %s", ipvlanType, parent, err) @@ -41,7 +41,7 @@ func createIPVlan(containerIfName, parent, ipvlanMode string) (string, error) { Mode: mode, } if err := ns.NlHandle().LinkAdd(ipvlan); err != nil { - // If a user creates a macvlan and ipvlan on same parent, only one slave iface can be active at a time. + // If a user creates a macvlan and ipvlan on same parent, only one subordinate iface can be active at a time. return "", fmt.Errorf("failed to create the %s port: %v", ipvlanType, err) } @@ -84,7 +84,7 @@ func createVlanLink(parentName string) error { // get the parent link to attach a vlan subinterface parentLink, err := ns.NlHandle().LinkByName(parent) if err != nil { - return fmt.Errorf("failed to find master interface %s on the Docker host: %v", parent, err) + return fmt.Errorf("failed to find main interface %s on the Docker host: %v", parent, err) } vlanLink := &netlink.Vlan{ LinkAttrs: netlink.LinkAttrs{ @@ -122,9 +122,9 @@ func delVlanLink(linkName string) error { } // verify a parent interface isn't being deleted if vlanLink.Attrs().ParentIndex == 0 { - return fmt.Errorf("interface %s does not appear to be a slave device: %v", linkName, err) + return fmt.Errorf("interface %s does not appear to be a subordinate device: %v", linkName, err) } - // delete the ipvlan slave device + // delete the ipvlan subordinate device if err := ns.NlHandle().LinkDel(vlanLink); err != nil { return fmt.Errorf("failed to delete %s link: %v", linkName, err) } @@ -135,7 +135,7 @@ func delVlanLink(linkName string) error { return nil } -// parseVlan parses and verifies a slave interface name: -o parent=eth0.10 +// parseVlan parses and verifies a subordinate interface name: -o parent=eth0.10 func parseVlan(linkName string) (string, int, error) { // parse -o parent=eth0.10 splitName := strings.Split(linkName, ".") diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/macvlan/macvlan_network.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/macvlan/macvlan_network.go index c455b91..ee865a5 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/macvlan/macvlan_network.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/macvlan/macvlan_network.go @@ -95,7 +95,7 @@ func (d *driver) createNetwork(config *configuration) error { if err != nil { return err } - config.CreatedSlaveLink = true + config.CreatedSubordinateLink = true // notify the user in logs they have limited comunicatins if config.Parent == getDummyName(stringid.TruncateID(config.ID)) { logrus.Debugf("Empty -o parent= and --internal flags limit communications to other containers inside of network: %s", @@ -108,8 +108,8 @@ func (d *driver) createNetwork(config *configuration) error { if err != nil { return err } - // if driver created the networks slave link, record it for future deletion - config.CreatedSlaveLink = true + // if driver created the networks subordinate link, record it for future deletion + config.CreatedSubordinateLink = true } } n := &network{ @@ -131,8 +131,8 @@ func (d *driver) DeleteNetwork(nid string) error { if n == nil { return fmt.Errorf("network id %s not found", nid) } - // if the driver created the slave interface, delete it, otherwise leave it - if ok := n.config.CreatedSlaveLink; ok { + // if the driver created the subordinate interface, delete it, otherwise leave it + if ok := n.config.CreatedSubordinateLink; ok { // if the interface exists, only delete if it matches iface.vlan or dummy.net_id naming if ok := parentExists(n.config.Parent); ok { // only delete the link if it is named the net_id diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/macvlan/macvlan_setup.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/macvlan/macvlan_setup.go index b5b4be3..102ecce 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/macvlan/macvlan_setup.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/drivers/macvlan/macvlan_setup.go @@ -16,7 +16,7 @@ const ( macvlanMajorVer = 9 // minimum macvlan major kernel support ) -// Create the macvlan slave specifying the source name +// Create the macvlan subordinate specifying the source name func createMacVlan(containerIfName, parent, macvlanMode string) (string, error) { // Set the macvlan mode. Default is bridge mode mode, err := setMacVlanMode(macvlanMode) @@ -27,7 +27,7 @@ func createMacVlan(containerIfName, parent, macvlanMode string) (string, error) if !parentExists(parent) { return "", fmt.Errorf("the requested parent interface %s was not found on the Docker host", parent) } - // Get the link for the master index (Example: the docker host eth iface) + // Get the link for the main index (Example: the docker host eth iface) parentLink, err := ns.NlHandle().LinkByName(parent) if err != nil { return "", fmt.Errorf("error occoured looking up the %s parent iface %s error: %s", macvlanType, parent, err) @@ -41,7 +41,7 @@ func createMacVlan(containerIfName, parent, macvlanMode string) (string, error) Mode: mode, } if err := ns.NlHandle().LinkAdd(macvlan); err != nil { - // If a user creates a macvlan and ipvlan on same parent, only one slave iface can be active at a time. + // If a user creates a macvlan and ipvlan on same parent, only one subordinate iface can be active at a time. return "", fmt.Errorf("failed to create the %s port: %v", macvlanType, err) } @@ -88,7 +88,7 @@ func createVlanLink(parentName string) error { // get the parent link to attach a vlan subinterface parentLink, err := ns.NlHandle().LinkByName(parent) if err != nil { - return fmt.Errorf("failed to find master interface %s on the Docker host: %v", parent, err) + return fmt.Errorf("failed to find main interface %s on the Docker host: %v", parent, err) } vlanLink := &netlink.Vlan{ LinkAttrs: netlink.LinkAttrs{ @@ -126,9 +126,9 @@ func delVlanLink(linkName string) error { } // verify a parent interface isn't being deleted if vlanLink.Attrs().ParentIndex == 0 { - return fmt.Errorf("interface %s does not appear to be a slave device: %v", linkName, err) + return fmt.Errorf("interface %s does not appear to be a subordinate device: %v", linkName, err) } - // delete the macvlan slave device + // delete the macvlan subordinate device if err := ns.NlHandle().LinkDel(vlanLink); err != nil { return fmt.Errorf("failed to delete %s link: %v", linkName, err) } @@ -139,7 +139,7 @@ func delVlanLink(linkName string) error { return nil } -// parseVlan parses and verifies a slave interface name: -o parent=eth0.10 +// parseVlan parses and verifies a subordinate interface name: -o parent=eth0.10 func parseVlan(linkName string) (string, int, error) { // parse -o parent=eth0.10 splitName := strings.Split(linkName, ".") diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/etchosts/etchosts.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/etchosts/etchosts.go index d55298a..780df08 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/etchosts/etchosts.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/etchosts/etchosts.go @@ -69,7 +69,7 @@ func Drop(path string) { // Build function // path is path to host file string required -// IP, hostname, and domainname set main record leave empty for no master record +// IP, hostname, and domainname set main record leave empty for no main record // extraContent is an array of extra host records. func Build(path, IP, hostname, domainname string, extraContent []Record) error { defer pathLock(path)() diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/ipam/structures.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/ipam/structures.go index 09a7769..525522e 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/ipam/structures.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/ipam/structures.go @@ -270,17 +270,17 @@ func (aSpace *addrSpace) updatePoolDBOnAdd(k SubnetKey, nw *net.IPNet, ipr *Addr return func() error { return nil }, nil } - // If master pool, check for overlap + // If main pool, check for overlap if ipr == nil { if aSpace.contains(k.AddressSpace, nw) { return nil, ipamapi.ErrPoolOverlap } - // This is a new master pool, add it along with corresponding bitmask + // This is a new main pool, add it along with corresponding bitmask aSpace.subnets[k] = &PoolData{Pool: nw, RefCount: 1} return func() error { return aSpace.alloc.insertBitMask(k, nw) }, nil } - // This is a new non-master pool + // This is a new non-main pool p := &PoolData{ ParentKey: SubnetKey{AddressSpace: k.AddressSpace, Subnet: k.Subnet}, Pool: nw, diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/ipam/utils.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/ipam/utils.go index 5117c55..14a6fee 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/ipam/utils.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/ipam/utils.go @@ -15,12 +15,12 @@ const ( v6 = 6 ) -func getAddressRange(pool string, masterNw *net.IPNet) (*AddressRange, error) { +func getAddressRange(pool string, mainNw *net.IPNet) (*AddressRange, error) { ip, nw, err := net.ParseCIDR(pool) if err != nil { return nil, ipamapi.ErrInvalidSubPool } - lIP, e := types.GetHostPartIP(nw.IP, masterNw.Mask) + lIP, e := types.GetHostPartIP(nw.IP, mainNw.Mask) if e != nil { return nil, fmt.Errorf("failed to compute range's lowest ip address: %v", e) } @@ -28,7 +28,7 @@ func getAddressRange(pool string, masterNw *net.IPNet) (*AddressRange, error) { if e != nil { return nil, fmt.Errorf("failed to compute range's broadcast ip address: %v", e) } - hIP, e := types.GetHostPartIP(bIP, masterNw.Mask) + hIP, e := types.GetHostPartIP(bIP, mainNw.Mask) if e != nil { return nil, fmt.Errorf("failed to compute range's highest ip address: %v", e) } diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/network.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/network.go index 8077770..fbceff6 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/network.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/network.go @@ -119,14 +119,14 @@ type networkDBTable struct { // IpamConf contains all the ipam related configurations for a network type IpamConf struct { - // The master address pool for containers and network interfaces + // The main address pool for containers and network interfaces PreferredPool string - // A subset of the master pool. If specified, + // A subset of the main pool. If specified, // this becomes the container pool SubPool string // Preferred Network Gateway address (optional) Gateway string - // Auxiliary addresses for network driver. Must be within the master pool. + // Auxiliary addresses for network driver. Must be within the main pool. // libnetwork will reserve them if they fall into the container pool AuxAddresses map[string]string } @@ -1371,7 +1371,7 @@ func (n *network) ipamAllocateVersion(ipVer int, ipam ipamapi.Ipam) error { } } - // Auxiliary addresses must be part of the master address pool + // Auxiliary addresses must be part of the main address pool // If they fall into the container addressable pool, libnetwork will reserve them if cfg.AuxAddresses != nil { var ip net.IP @@ -1381,7 +1381,7 @@ func (n *network) ipamAllocateVersion(ipVer int, ipam ipamapi.Ipam) error { return types.BadRequestErrorf("non parsable secondary ip address (%s:%s) passed for network %s", k, v, n.Name()) } if !d.Pool.Contains(ip) { - return types.ForbiddenErrorf("auxilairy address: (%s:%s) must belong to the master pool: %s", k, v, d.Pool) + return types.ForbiddenErrorf("auxilairy address: (%s:%s) must belong to the main pool: %s", k, v, d.Pool) } // Attempt reservation in the container addressable pool, silent the error if address does not belong to that pool if d.IPAMData.AuxAddresses[k], _, err = ipam.RequestAddress(d.PoolID, ip, nil); err != nil && err != ipamapi.ErrIPOutOfRange { diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/osl/interface_linux.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/osl/interface_linux.go index 8e8a830..d687607 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/osl/interface_linux.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/osl/interface_linux.go @@ -21,8 +21,8 @@ type IfaceOption func(i *nwIface) type nwIface struct { srcName string dstName string - master string - dstMaster string + main string + dstMain string mac net.HardwareAddr address *net.IPNet addressIPv6 *net.IPNet @@ -48,11 +48,11 @@ func (i *nwIface) DstName() string { return i.dstName } -func (i *nwIface) DstMaster() string { +func (i *nwIface) DstMain() string { i.Lock() defer i.Unlock() - return i.dstMaster + return i.dstMain } func (i *nwIface) Bridge() bool { @@ -62,11 +62,11 @@ func (i *nwIface) Bridge() bool { return i.bridge } -func (i *nwIface) Master() string { +func (i *nwIface) Main() string { i.Lock() defer i.Unlock() - return i.master + return i.main } func (i *nwIface) MacAddress() net.HardwareAddr { @@ -215,8 +215,8 @@ func (n *networkNamespace) findDst(srcName string, isBridge bool) string { defer n.Unlock() for _, i := range n.iFaces { - // The master should match the srcname of the interface and the - // master interface should be of type bridge, if searching for a bridge type + // The main should match the srcname of the interface and the + // main interface should be of type bridge, if searching for a bridge type if i.SrcName() == srcName && (!isBridge || i.Bridge()) { return i.DstName() } @@ -229,11 +229,11 @@ func (n *networkNamespace) AddInterface(srcName, dstPrefix string, options ...If i := &nwIface{srcName: srcName, dstName: dstPrefix, ns: n} i.processInterfaceOptions(options...) - if i.master != "" { - i.dstMaster = n.findDst(i.master, true) - if i.dstMaster == "" { - return fmt.Errorf("could not find an appropriate master %q for %q", - i.master, i.srcName) + if i.main != "" { + i.dstMain = n.findDst(i.main, true) + if i.dstMain == "" { + return fmt.Errorf("could not find an appropriate main %q for %q", + i.main, i.srcName) } } @@ -335,7 +335,7 @@ func configureInterface(nlh *netlink.Handle, iface netlink.Link, i *nwIface) err {setInterfaceMAC, fmt.Sprintf("error setting interface %q MAC to %q", ifaceName, i.MacAddress())}, {setInterfaceIP, fmt.Sprintf("error setting interface %q IP to %v", ifaceName, i.Address())}, {setInterfaceIPv6, fmt.Sprintf("error setting interface %q IPv6 to %v", ifaceName, i.AddressIPv6())}, - {setInterfaceMaster, fmt.Sprintf("error setting interface %q master to %q", ifaceName, i.DstMaster())}, + {setInterfaceMain, fmt.Sprintf("error setting interface %q main to %q", ifaceName, i.DstMain())}, {setInterfaceLinkLocalIPs, fmt.Sprintf("error setting interface %q link local IPs to %v", ifaceName, i.LinkLocalAddresses())}, {setInterfaceIPAliases, fmt.Sprintf("error setting interface %q IP Aliases to %v", ifaceName, i.IPAliases())}, } @@ -348,13 +348,13 @@ func configureInterface(nlh *netlink.Handle, iface netlink.Link, i *nwIface) err return nil } -func setInterfaceMaster(nlh *netlink.Handle, iface netlink.Link, i *nwIface) error { - if i.DstMaster() == "" { +func setInterfaceMain(nlh *netlink.Handle, iface netlink.Link, i *nwIface) error { + if i.DstMain() == "" { return nil } - return nlh.LinkSetMaster(iface, &netlink.Bridge{ - LinkAttrs: netlink.LinkAttrs{Name: i.DstMaster()}}) + return nlh.LinkSetMain(iface, &netlink.Bridge{ + LinkAttrs: netlink.LinkAttrs{Name: i.DstMain()}}) } func setInterfaceMAC(nlh *netlink.Handle, iface netlink.Link, i *nwIface) error { diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/osl/namespace_linux.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/osl/namespace_linux.go index d6b9d78..c9da032 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/osl/namespace_linux.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/osl/namespace_linux.go @@ -438,11 +438,11 @@ func (n *networkNamespace) Restore(ifsopt map[string][]IfaceOption, routes []*ty dstPrefix := seps[1] i := &nwIface{srcName: srcName, dstName: dstPrefix, ns: n} i.processInterfaceOptions(opts...) - if i.master != "" { - i.dstMaster = n.findDst(i.master, true) - if i.dstMaster == "" { - return fmt.Errorf("could not find an appropriate master %q for %q", - i.master, i.srcName) + if i.main != "" { + i.dstMain = n.findDst(i.main, true) + if i.dstMain == "" { + return fmt.Errorf("could not find an appropriate main %q for %q", + i.main, i.srcName) } } if n.isDefault { @@ -481,7 +481,7 @@ func (n *networkNamespace) Restore(ifsopt map[string][]IfaceOption, routes []*ty } // This is to find the interface name of the pair in overlay sandbox if strings.HasPrefix(ifaceName, "veth") { - if i.master != "" && i.dstName == "veth" { + if i.main != "" && i.dstName == "veth" { i.dstName = ifaceName } } diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/osl/options_linux.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/osl/options_linux.go index 64309d0..b8329a7 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/osl/options_linux.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/osl/options_linux.go @@ -36,9 +36,9 @@ func (n *networkNamespace) Bridge(isBridge bool) IfaceOption { } } -func (n *networkNamespace) Master(name string) IfaceOption { +func (n *networkNamespace) Main(name string) IfaceOption { return func(i *nwIface) { - i.master = name + i.main = name } } diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/osl/sandbox.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/osl/sandbox.go index 64288f9..eb3601d 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/osl/sandbox.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/libnetwork/osl/sandbox.go @@ -94,10 +94,10 @@ type IfaceOptionSetter interface { // IPAliases returns an option setter to set IP address Aliases IPAliases([]*net.IPNet) IfaceOption - // Master returns an option setter to set the master interface if any for this - // interface. The master interface name should refer to the srcname of a + // Main returns an option setter to set the main interface if any for this + // interface. The main interface name should refer to the srcname of a // previously added interface of type bridge. - Master(string) IfaceOption + Main(string) IfaceOption // Address returns an option setter to set interface routes. Routes([]*net.IPNet) IfaceOption @@ -159,8 +159,8 @@ type Interface interface { // Bridge returns true if the interface is a bridge Bridge() bool - // Master returns the srcname of the master interface for this interface. - Master() string + // Main returns the srcname of the main interface for this interface. + Main() string // Remove an interface from the sandbox by renaming to original name // and moving it out of the sandbox. diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/agent/session.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/agent/session.go index e15714a..f100736 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/agent/session.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/agent/session.go @@ -25,7 +25,7 @@ var ( // starts the registration and heartbeat control cycle. Any failure will result // in a complete shutdown of the session and it must be reestablished. // -// All communication with the master is done through session. Changes that +// All communication with the main is done through session. Changes that // flow into the agent, such as task assignment, are called back into the // agent through errs, messages and tasks. type session struct { diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/api/types.pb.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/api/types.pb.go index bbf1b87..e1a6667 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/api/types.pb.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/api/types.pb.go @@ -418,8 +418,8 @@ const ( MountPropagationPrivate Mount_BindOptions_MountPropagation = 1 MountPropagationRShared Mount_BindOptions_MountPropagation = 2 MountPropagationShared Mount_BindOptions_MountPropagation = 3 - MountPropagationRSlave Mount_BindOptions_MountPropagation = 4 - MountPropagationSlave Mount_BindOptions_MountPropagation = 5 + MountPropagationRSubordinate Mount_BindOptions_MountPropagation = 4 + MountPropagationSubordinate Mount_BindOptions_MountPropagation = 5 ) var Mount_BindOptions_MountPropagation_name = map[int32]string{ @@ -1229,7 +1229,7 @@ type IPAMConfig struct { Range string `protobuf:"bytes,3,opt,name=range,proto3" json:"range,omitempty"` // Gateway address within the subnet. Gateway string `protobuf:"bytes,4,opt,name=gateway,proto3" json:"gateway,omitempty"` - // Reserved is a list of address from the master pool that should *not* be + // Reserved is a list of address from the main pool that should *not* be // allocated. These addresses may have already been allocated or may be // reserved for another allocation manager. Reserved map[string]string `protobuf:"bytes,5,rep,name=reserved" json:"reserved,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/manager/allocator/networkallocator/portallocator.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/manager/allocator/networkallocator/portallocator.go index 8df3cf3..3311d4d 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/manager/allocator/networkallocator/portallocator.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/manager/allocator/networkallocator/portallocator.go @@ -16,15 +16,15 @@ const ( // allocated when the user did not specify a port. dynamicPortEnd = 32767 - // The start of master port range which will hold all the + // The start of main port range which will hold all the // allocation state of ports allocated so far regardless of // whether it was user defined or not. - masterPortStart = 1 + mainPortStart = 1 - // The end of master port range which will hold all the + // The end of main port range which will hold all the // allocation state of ports allocated so far regardless of // whether it was user defined or not. - masterPortEnd = 65535 + mainPortEnd = 65535 ) type portAllocator struct { @@ -34,7 +34,7 @@ type portAllocator struct { type portSpace struct { protocol api.PortConfig_Protocol - masterPortSpace *idm.Idm + mainPortSpace *idm.Idm dynamicPortSpace *idm.Idm } @@ -118,10 +118,10 @@ func newPortAllocator() (*portAllocator, error) { } func newPortSpace(protocol api.PortConfig_Protocol) (*portSpace, error) { - masterName := fmt.Sprintf("%s-master-ports", protocol) + mainName := fmt.Sprintf("%s-main-ports", protocol) dynamicName := fmt.Sprintf("%s-dynamic-ports", protocol) - master, err := idm.New(nil, masterName, masterPortStart, masterPortEnd) + main, err := idm.New(nil, mainName, mainPortStart, mainPortEnd) if err != nil { return nil, err } @@ -133,7 +133,7 @@ func newPortSpace(protocol api.PortConfig_Protocol) (*portSpace, error) { return &portSpace{ protocol: protocol, - masterPortSpace: master, + mainPortSpace: main, dynamicPortSpace: dynamic, }, nil } @@ -378,7 +378,7 @@ func (ps *portSpace) allocate(p *api.PortConfig) (err error) { }() } - return ps.masterPortSpace.GetSpecificID(uint64(p.PublishedPort)) + return ps.mainPortSpace.GetSpecificID(uint64(p.PublishedPort)) } // Check out an arbitrary port from dynamic port space. @@ -392,8 +392,8 @@ func (ps *portSpace) allocate(p *api.PortConfig) (err error) { } }() - // Make sure we allocate the same port from the master space. - if err = ps.masterPortSpace.GetSpecificID(uint64(swarmPort)); err != nil { + // Make sure we allocate the same port from the main space. + if err = ps.mainPortSpace.GetSpecificID(uint64(swarmPort)); err != nil { return } @@ -406,5 +406,5 @@ func (ps *portSpace) free(p *api.PortConfig) { ps.dynamicPortSpace.Release(uint64(p.PublishedPort)) } - ps.masterPortSpace.Release(uint64(p.PublishedPort)) + ps.mainPortSpace.Release(uint64(p.PublishedPort)) } diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/manager/scheduler/scheduler.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/manager/scheduler/scheduler.go index ccb165d..6843705 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/manager/scheduler/scheduler.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/manager/scheduler/scheduler.go @@ -393,7 +393,7 @@ func (s *Scheduler) applySchedulingDecisions(ctx context.Context, schedulingDeci successful = make([]schedulingDecision, 0, len(schedulingDecisions)) - // Apply changes to master store + // Apply changes to main store applied, err := s.store.Batch(func(batch *store.Batch) error { for len(schedulingDecisions) > 0 { err := batch.Update(func(tx store.Tx) error { diff --git a/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/remotes/remotes.go b/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/remotes/remotes.go index e79ed3f..9e763a0 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/remotes/remotes.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/docker/swarmkit/remotes/remotes.go @@ -31,7 +31,7 @@ type Remotes interface { // // The observation will be used to calculate a moving weight, which is // implementation dependent. This method will be called such that repeated - // observations of the same master in each session request are favored. + // observations of the same main in each session request are favored. Observe(peer api.Peer, weight int) // ObserveIfExists records an experience with a particular remote if when a @@ -84,7 +84,7 @@ func (mwr *remotesWeightedRandom) Select(excludes ...string) (api.Peer, error) { // NOTE(stevvooe): We then use a weighted random selection algorithm // (http://stackoverflow.com/questions/4463561/weighted-random-selection-from-array) - // to choose the master to connect to. + // to choose the main to connect to. // // It is possible that this is insufficient. The following may inform a // better solution: @@ -92,7 +92,7 @@ func (mwr *remotesWeightedRandom) Select(excludes ...string) (api.Peer, error) { // https://github.com/LK4D4/sample // // The first link applies exponential distribution weight choice reservoir - // sampling. This may be relevant if we view the master selection as a + // sampling. This may be relevant if we view the main selection as a // distributed reservoir sampling problem. // bias to zero-weighted remotes have same probability. otherwise, we diff --git a/docker/moby-17.05.0-ce/vendor/github.com/kr/pty/pty_freebsd.go b/docker/moby-17.05.0-ce/vendor/github.com/kr/pty/pty_freebsd.go index b341bab..1bb8a5e 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/kr/pty/pty_freebsd.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/kr/pty/pty_freebsd.go @@ -35,7 +35,7 @@ func open() (pty, tty *os.File, err error) { return p, t, nil } -func isptmaster(fd uintptr) (bool, error) { +func isptmain(fd uintptr) (bool, error) { err := ioctl(fd, syscall.TIOCPTMASTER, 0) return err == nil, err } @@ -46,11 +46,11 @@ var ( ) func ptsname(f *os.File) (string, error) { - master, err := isptmaster(f.Fd()) + main, err := isptmain(f.Fd()) if err != nil { return "", err } - if !master { + if !main { return "", syscall.EINVAL } diff --git a/docker/moby-17.05.0-ce/vendor/github.com/kr/pty/pty_linux.go b/docker/moby-17.05.0-ce/vendor/github.com/kr/pty/pty_linux.go index cb901a2..f54b244 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/kr/pty/pty_linux.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/kr/pty/pty_linux.go @@ -41,6 +41,6 @@ func ptsname(f *os.File) (string, error) { func unlockpt(f *os.File) error { var u _C_int - // use TIOCSPTLCK with a zero valued arg to clear the slave pty lock + // use TIOCSPTLCK with a zero valued arg to clear the subordinate pty lock return ioctl(f.Fd(), syscall.TIOCSPTLCK, uintptr(unsafe.Pointer(&u))) } diff --git a/docker/moby-17.05.0-ce/vendor/github.com/miekg/dns/xfr.go b/docker/moby-17.05.0-ce/vendor/github.com/miekg/dns/xfr.go index 7d3a67b..3010aff 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/miekg/dns/xfr.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/miekg/dns/xfr.go @@ -28,10 +28,10 @@ type Transfer struct { // in the Transfer.Conn: // // d := net.Dialer{LocalAddr: transfer_source} -// con, err := d.Dial("tcp", master) +// con, err := d.Dial("tcp", main) // dnscon := &dns.Conn{Conn:con} // transfer = &dns.Transfer{Conn: dnscon} -// channel, err := transfer.In(message, master) +// channel, err := transfer.In(message, main) // func (t *Transfer) In(q *Msg, a string) (env chan *Envelope, err error) { timeout := dnsTimeout diff --git a/docker/moby-17.05.0-ce/vendor/github.com/vishvananda/netlink/handle_unspecified.go b/docker/moby-17.05.0-ce/vendor/github.com/vishvananda/netlink/handle_unspecified.go index 32cf022..157fcaa 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/vishvananda/netlink/handle_unspecified.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/vishvananda/netlink/handle_unspecified.go @@ -77,15 +77,15 @@ func (h *Handle) LinkSetVfTxRate(link Link, vf, rate int) error { return ErrNotImplemented } -func (h *Handle) LinkSetMaster(link Link, master *Bridge) error { +func (h *Handle) LinkSetMain(link Link, main *Bridge) error { return ErrNotImplemented } -func (h *Handle) LinkSetNoMaster(link Link) error { +func (h *Handle) LinkSetNoMain(link Link) error { return ErrNotImplemented } -func (h *Handle) LinkSetMasterByIndex(link Link, masterIndex int) error { +func (h *Handle) LinkSetMainByIndex(link Link, mainIndex int) error { return ErrNotImplemented } diff --git a/docker/moby-17.05.0-ce/vendor/github.com/vishvananda/netlink/link.go b/docker/moby-17.05.0-ce/vendor/github.com/vishvananda/netlink/link.go index 924211c..1f397a5 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/vishvananda/netlink/link.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/vishvananda/netlink/link.go @@ -28,7 +28,7 @@ type LinkAttrs struct { Flags net.Flags RawFlags uint32 ParentIndex int // index of the parent link device - MasterIndex int // must be the index of a bridge + MainIndex int // must be the index of a bridge Namespace interface{} // nil | NsPid | NsFd Alias string Statistics *LinkStatistics @@ -568,7 +568,7 @@ type BondAdInfo struct { type Bond struct { LinkAttrs Mode BondMode - ActiveSlave int + ActiveSubordinate int Miimon int UpDelay int DownDelay int @@ -583,10 +583,10 @@ type Bond struct { XmitHashPolicy BondXmitHashPolicy ResendIgmp int NumPeerNotif int - AllSlavesActive int + AllSubordinatesActive int MinLinks int LpInterval int - PackersPerSlave int + PackersPerSubordinate int LacpRate BondLacpRate AdSelect BondAdSelect // looking at iproute tool AdInfo can only be retrived. It can't be set. @@ -597,7 +597,7 @@ func NewLinkBond(atr LinkAttrs) *Bond { return &Bond{ LinkAttrs: atr, Mode: -1, - ActiveSlave: -1, + ActiveSubordinate: -1, Miimon: -1, UpDelay: -1, DownDelay: -1, @@ -612,10 +612,10 @@ func NewLinkBond(atr LinkAttrs) *Bond { XmitHashPolicy: -1, ResendIgmp: -1, NumPeerNotif: -1, - AllSlavesActive: -1, + AllSubordinatesActive: -1, MinLinks: -1, LpInterval: -1, - PackersPerSlave: -1, + PackersPerSubordinate: -1, LacpRate: -1, AdSelect: -1, } @@ -735,4 +735,4 @@ func (vrf *Vrf) Type() string { // vlan | veth | vcan | dummy | ifb | macvlan | macvtap | // bridge | bond | ipoib | ip6tnl | ipip | sit | vxlan | // gre | gretap | ip6gre | ip6gretap | vti | nlmon | -// bond_slave | ipvlan +// bond_subordinate | ipvlan diff --git a/docker/moby-17.05.0-ce/vendor/github.com/vishvananda/netlink/link_linux.go b/docker/moby-17.05.0-ce/vendor/github.com/vishvananda/netlink/link_linux.go index 0c04d3a..421efc3 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/vishvananda/netlink/link_linux.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/vishvananda/netlink/link_linux.go @@ -369,48 +369,48 @@ func (h *Handle) LinkSetVfTxRate(link Link, vf, rate int) error { return err } -// LinkSetMaster sets the master of the link device. -// Equivalent to: `ip link set $link master $master` -func LinkSetMaster(link Link, master *Bridge) error { - return pkgHandle.LinkSetMaster(link, master) +// LinkSetMain sets the main of the link device. +// Equivalent to: `ip link set $link main $main` +func LinkSetMain(link Link, main *Bridge) error { + return pkgHandle.LinkSetMain(link, main) } -// LinkSetMaster sets the master of the link device. -// Equivalent to: `ip link set $link master $master` -func (h *Handle) LinkSetMaster(link Link, master *Bridge) error { +// LinkSetMain sets the main of the link device. +// Equivalent to: `ip link set $link main $main` +func (h *Handle) LinkSetMain(link Link, main *Bridge) error { index := 0 - if master != nil { - masterBase := master.Attrs() - h.ensureIndex(masterBase) - index = masterBase.Index + if main != nil { + mainBase := main.Attrs() + h.ensureIndex(mainBase) + index = mainBase.Index } if index <= 0 { return fmt.Errorf("Device does not exist") } - return h.LinkSetMasterByIndex(link, index) + return h.LinkSetMainByIndex(link, index) } -// LinkSetNoMaster removes the master of the link device. -// Equivalent to: `ip link set $link nomaster` -func LinkSetNoMaster(link Link) error { - return pkgHandle.LinkSetNoMaster(link) +// LinkSetNoMain removes the main of the link device. +// Equivalent to: `ip link set $link nomain` +func LinkSetNoMain(link Link) error { + return pkgHandle.LinkSetNoMain(link) } -// LinkSetNoMaster removes the master of the link device. -// Equivalent to: `ip link set $link nomaster` -func (h *Handle) LinkSetNoMaster(link Link) error { - return h.LinkSetMasterByIndex(link, 0) +// LinkSetNoMain removes the main of the link device. +// Equivalent to: `ip link set $link nomain` +func (h *Handle) LinkSetNoMain(link Link) error { + return h.LinkSetMainByIndex(link, 0) } -// LinkSetMasterByIndex sets the master of the link device. -// Equivalent to: `ip link set $link master $master` -func LinkSetMasterByIndex(link Link, masterIndex int) error { - return pkgHandle.LinkSetMasterByIndex(link, masterIndex) +// LinkSetMainByIndex sets the main of the link device. +// Equivalent to: `ip link set $link main $main` +func LinkSetMainByIndex(link Link, mainIndex int) error { + return pkgHandle.LinkSetMainByIndex(link, mainIndex) } -// LinkSetMasterByIndex sets the master of the link device. -// Equivalent to: `ip link set $link master $master` -func (h *Handle) LinkSetMasterByIndex(link Link, masterIndex int) error { +// LinkSetMainByIndex sets the main of the link device. +// Equivalent to: `ip link set $link main $main` +func (h *Handle) LinkSetMainByIndex(link Link, mainIndex int) error { base := link.Attrs() h.ensureIndex(base) req := h.newNetlinkRequest(syscall.RTM_SETLINK, syscall.NLM_F_ACK) @@ -420,7 +420,7 @@ func (h *Handle) LinkSetMasterByIndex(link Link, masterIndex int) error { req.AddData(msg) b := make([]byte, 4) - native.PutUint32(b, uint32(masterIndex)) + native.PutUint32(b, uint32(mainIndex)) data := nl.NewRtAttr(syscall.IFLA_MASTER, b) req.AddData(data) @@ -585,8 +585,8 @@ func addBondAttrs(bond *Bond, linkInfo *nl.RtAttr) { if bond.Mode >= 0 { nl.NewRtAttrChild(data, nl.IFLA_BOND_MODE, nl.Uint8Attr(uint8(bond.Mode))) } - if bond.ActiveSlave >= 0 { - nl.NewRtAttrChild(data, nl.IFLA_BOND_ACTIVE_SLAVE, nl.Uint32Attr(uint32(bond.ActiveSlave))) + if bond.ActiveSubordinate >= 0 { + nl.NewRtAttrChild(data, nl.IFLA_BOND_ACTIVE_SLAVE, nl.Uint32Attr(uint32(bond.ActiveSubordinate))) } if bond.Miimon >= 0 { nl.NewRtAttrChild(data, nl.IFLA_BOND_MIIMON, nl.Uint32Attr(uint32(bond.Miimon))) @@ -641,8 +641,8 @@ func addBondAttrs(bond *Bond, linkInfo *nl.RtAttr) { if bond.NumPeerNotif >= 0 { nl.NewRtAttrChild(data, nl.IFLA_BOND_NUM_PEER_NOTIF, nl.Uint8Attr(uint8(bond.NumPeerNotif))) } - if bond.AllSlavesActive >= 0 { - nl.NewRtAttrChild(data, nl.IFLA_BOND_ALL_SLAVES_ACTIVE, nl.Uint8Attr(uint8(bond.AllSlavesActive))) + if bond.AllSubordinatesActive >= 0 { + nl.NewRtAttrChild(data, nl.IFLA_BOND_ALL_SLAVES_ACTIVE, nl.Uint8Attr(uint8(bond.AllSubordinatesActive))) } if bond.MinLinks >= 0 { nl.NewRtAttrChild(data, nl.IFLA_BOND_MIN_LINKS, nl.Uint32Attr(uint32(bond.MinLinks))) @@ -650,8 +650,8 @@ func addBondAttrs(bond *Bond, linkInfo *nl.RtAttr) { if bond.LpInterval >= 0 { nl.NewRtAttrChild(data, nl.IFLA_BOND_LP_INTERVAL, nl.Uint32Attr(uint32(bond.LpInterval))) } - if bond.PackersPerSlave >= 0 { - nl.NewRtAttrChild(data, nl.IFLA_BOND_PACKETS_PER_SLAVE, nl.Uint32Attr(uint32(bond.PackersPerSlave))) + if bond.PackersPerSubordinate >= 0 { + nl.NewRtAttrChild(data, nl.IFLA_BOND_PACKETS_PER_SLAVE, nl.Uint32Attr(uint32(bond.PackersPerSubordinate))) } if bond.LacpRate >= 0 { nl.NewRtAttrChild(data, nl.IFLA_BOND_AD_LACP_RATE, nl.Uint8Attr(uint8(bond.LacpRate))) @@ -711,10 +711,10 @@ func (h *Handle) LinkAdd(link Link) error { } h.ensureIndex(base) - // can't set master during create, so set it afterwards - if base.MasterIndex != 0 { - // TODO: verify MasterIndex is actually a bridge? - return h.LinkSetMasterByIndex(link, base.MasterIndex) + // can't set main during create, so set it afterwards + if base.MainIndex != 0 { + // TODO: verify MainIndex is actually a bridge? + return h.LinkSetMainByIndex(link, base.MainIndex) } return nil } @@ -841,10 +841,10 @@ func (h *Handle) LinkAdd(link Link) error { h.ensureIndex(base) - // can't set master during create, so set it afterwards - if base.MasterIndex != 0 { - // TODO: verify MasterIndex is actually a bridge? - return h.LinkSetMasterByIndex(link, base.MasterIndex) + // can't set main during create, so set it afterwards + if base.MainIndex != 0 { + // TODO: verify MainIndex is actually a bridge? + return h.LinkSetMainByIndex(link, base.MainIndex) } return nil } @@ -1112,7 +1112,7 @@ func LinkDeserialize(hdr *syscall.NlMsghdr, m []byte) (Link, error) { case syscall.IFLA_LINK: base.ParentIndex = int(native.Uint32(attr.Value[0:4])) case syscall.IFLA_MASTER: - base.MasterIndex = int(native.Uint32(attr.Value[0:4])) + base.MainIndex = int(native.Uint32(attr.Value[0:4])) case syscall.IFLA_TXQLEN: base.TxQLen = int(native.Uint32(attr.Value[0:4])) case syscall.IFLA_IFALIAS: @@ -1376,7 +1376,7 @@ func parseBondData(link Link, data []syscall.NetlinkRouteAttr) { case nl.IFLA_BOND_MODE: bond.Mode = BondMode(data[i].Value[0]) case nl.IFLA_BOND_ACTIVE_SLAVE: - bond.ActiveSlave = int(native.Uint32(data[i].Value[0:4])) + bond.ActiveSubordinate = int(native.Uint32(data[i].Value[0:4])) case nl.IFLA_BOND_MIIMON: bond.Miimon = int(native.Uint32(data[i].Value[0:4])) case nl.IFLA_BOND_UPDELAY: @@ -1406,13 +1406,13 @@ func parseBondData(link Link, data []syscall.NetlinkRouteAttr) { case nl.IFLA_BOND_NUM_PEER_NOTIF: bond.NumPeerNotif = int(data[i].Value[0]) case nl.IFLA_BOND_ALL_SLAVES_ACTIVE: - bond.AllSlavesActive = int(data[i].Value[0]) + bond.AllSubordinatesActive = int(data[i].Value[0]) case nl.IFLA_BOND_MIN_LINKS: bond.MinLinks = int(native.Uint32(data[i].Value[0:4])) case nl.IFLA_BOND_LP_INTERVAL: bond.LpInterval = int(native.Uint32(data[i].Value[0:4])) case nl.IFLA_BOND_PACKETS_PER_SLAVE: - bond.PackersPerSlave = int(native.Uint32(data[i].Value[0:4])) + bond.PackersPerSubordinate = int(native.Uint32(data[i].Value[0:4])) case nl.IFLA_BOND_AD_LACP_RATE: bond.LacpRate = BondLacpRate(data[i].Value[0]) case nl.IFLA_BOND_AD_SELECT: diff --git a/docker/moby-17.05.0-ce/vendor/github.com/vishvananda/netlink/netlink_unspecified.go b/docker/moby-17.05.0-ce/vendor/github.com/vishvananda/netlink/netlink_unspecified.go index 2d57c16..b63224e 100755 --- a/docker/moby-17.05.0-ce/vendor/github.com/vishvananda/netlink/netlink_unspecified.go +++ b/docker/moby-17.05.0-ce/vendor/github.com/vishvananda/netlink/netlink_unspecified.go @@ -16,7 +16,7 @@ func LinkSetMTU(link Link, mtu int) error { return ErrNotImplemented } -func LinkSetMaster(link Link, master *Bridge) error { +func LinkSetMain(link Link, main *Bridge) error { return ErrNotImplemented } @@ -52,11 +52,11 @@ func LinkSetVfTxRate(link Link, vf, rate int) error { return ErrNotImplemented } -func LinkSetNoMaster(link Link) error { +func LinkSetNoMain(link Link) error { return ErrNotImplemented } -func LinkSetMasterByIndex(link Link, masterIndex int) error { +func LinkSetMainByIndex(link Link, mainIndex int) error { return ErrNotImplemented } diff --git a/docker/moby-17.05.0-ce/volume/volume_propagation_linux_test.go b/docker/moby-17.05.0-ce/volume/volume_propagation_linux_test.go index 46d0265..c325d8b 100755 --- a/docker/moby-17.05.0-ce/volume/volume_propagation_linux_test.go +++ b/docker/moby-17.05.0-ce/volume/volume_propagation_linux_test.go @@ -16,33 +16,33 @@ func TestParseMountRawPropagation(t *testing.T) { valid = []string{ "/hostPath:/containerPath:shared", "/hostPath:/containerPath:rshared", - "/hostPath:/containerPath:slave", - "/hostPath:/containerPath:rslave", + "/hostPath:/containerPath:subordinate", + "/hostPath:/containerPath:rsubordinate", "/hostPath:/containerPath:private", "/hostPath:/containerPath:rprivate", "/hostPath:/containerPath:ro,shared", - "/hostPath:/containerPath:ro,slave", + "/hostPath:/containerPath:ro,subordinate", "/hostPath:/containerPath:ro,private", "/hostPath:/containerPath:ro,z,shared", - "/hostPath:/containerPath:ro,Z,slave", - "/hostPath:/containerPath:Z,ro,slave", - "/hostPath:/containerPath:slave,Z,ro", - "/hostPath:/containerPath:Z,slave,ro", - "/hostPath:/containerPath:slave,ro,Z", - "/hostPath:/containerPath:rslave,ro,Z", + "/hostPath:/containerPath:ro,Z,subordinate", + "/hostPath:/containerPath:Z,ro,subordinate", + "/hostPath:/containerPath:subordinate,Z,ro", + "/hostPath:/containerPath:Z,subordinate,ro", + "/hostPath:/containerPath:subordinate,ro,Z", + "/hostPath:/containerPath:rsubordinate,ro,Z", "/hostPath:/containerPath:ro,rshared,Z", "/hostPath:/containerPath:ro,Z,rprivate", } invalid = map[string]string{ - "/path:/path:ro,rshared,rslave": `invalid mode`, - "/path:/path:ro,z,rshared,rslave": `invalid mode`, + "/path:/path:ro,rshared,rsubordinate": `invalid mode`, + "/path:/path:ro,z,rshared,rsubordinate": `invalid mode`, "/path:shared": "invalid volume specification", - "/path:slave": "invalid volume specification", + "/path:subordinate": "invalid volume specification", "/path:private": "invalid volume specification", "name:/absolute-path:shared": "invalid volume specification", "name:/absolute-path:rshared": "invalid volume specification", - "name:/absolute-path:slave": "invalid volume specification", - "name:/absolute-path:rslave": "invalid volume specification", + "name:/absolute-path:subordinate": "invalid volume specification", + "name:/absolute-path:rsubordinate": "invalid volume specification", "name:/absolute-path:private": "invalid volume specification", "name:/absolute-path:rprivate": "invalid volume specification", } diff --git a/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mount/flags.go b/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mount/flags.go index 17dbd7a..137ebbd 100755 --- a/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mount/flags.go +++ b/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mount/flags.go @@ -43,8 +43,8 @@ func parseOptions(options string) (int, string) { "rprivate": {false, RPRIVATE}, "shared": {false, SHARED}, "rshared": {false, RSHARED}, - "slave": {false, SLAVE}, - "rslave": {false, RSLAVE}, + "subordinate": {false, SLAVE}, + "rsubordinate": {false, RSLAVE}, "relatime": {false, RELATIME}, "norelatime": {true, RELATIME}, "strictatime": {false, STRICTATIME}, diff --git a/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mount/flags_linux.go b/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mount/flags_linux.go index 2f9f5c5..15aea58 100755 --- a/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mount/flags_linux.go +++ b/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mount/flags_linux.go @@ -60,7 +60,7 @@ const ( // RPRIVATE marks the entire mount tree as PRIVATE. RPRIVATE = syscall.MS_PRIVATE | syscall.MS_REC - // SLAVE creates a mount which receives propagation from its master, but not + // SLAVE creates a mount which receives propagation from its main, but not // vice versa. SLAVE = syscall.MS_SLAVE diff --git a/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mount/mountinfo_linux.go b/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mount/mountinfo_linux.go index be69fee..e5feed2 100755 --- a/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mount/mountinfo_linux.go +++ b/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mount/mountinfo_linux.go @@ -11,7 +11,7 @@ import ( ) const ( - /* 36 35 98:0 /mnt1 /mnt2 rw,noatime master:1 - ext3 /dev/root rw,errors=continue + /* 36 35 98:0 /mnt1 /mnt2 rw,noatime main:1 - ext3 /dev/root rw,errors=continue (1)(2)(3) (4) (5) (6) (7) (8) (9) (10) (11) (1) mount ID: unique identifier of the mount (may be reused after umount) diff --git a/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mount/sharedsubtree_linux.go b/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mount/sharedsubtree_linux.go index 47303bb..5980416 100755 --- a/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mount/sharedsubtree_linux.go +++ b/opencontainers/runc/Godeps/_workspace/src/github.com/docker/docker/pkg/mount/sharedsubtree_linux.go @@ -26,16 +26,16 @@ func MakeRPrivate(mountPoint string) error { return ensureMountedAs(mountPoint, "rprivate") } -// MakeSlave ensures a mounted filesystem has the SLAVE mount option enabled. +// MakeSubordinate ensures a mounted filesystem has the SLAVE mount option enabled. // See the supported options in flags.go for further reference. -func MakeSlave(mountPoint string) error { - return ensureMountedAs(mountPoint, "slave") +func MakeSubordinate(mountPoint string) error { + return ensureMountedAs(mountPoint, "subordinate") } -// MakeRSlave ensures a mounted filesystem has the RSLAVE mount option enabled. +// MakeRSubordinate ensures a mounted filesystem has the RSLAVE mount option enabled. // See the supported options in flags.go for further reference. -func MakeRSlave(mountPoint string) error { - return ensureMountedAs(mountPoint, "rslave") +func MakeRSubordinate(mountPoint string) error { + return ensureMountedAs(mountPoint, "rsubordinate") } // MakeUnbindable ensures a mounted filesystem has the UNBINDABLE mount option diff --git a/opencontainers/runc/create.go b/opencontainers/runc/create.go index 2249e65..d4d463c 100755 --- a/opencontainers/runc/create.go +++ b/opencontainers/runc/create.go @@ -32,7 +32,7 @@ command(s) that get executed on start, edit the args parameter of the spec. See cli.StringFlag{ Name: "console", Value: "", - Usage: "specify the pty slave path for use with the container", + Usage: "specify the pty subordinate path for use with the container", }, cli.StringFlag{ Name: "pid-file", diff --git a/opencontainers/runc/exec.go b/opencontainers/runc/exec.go index a0b4f4f..bb94ede 100755 --- a/opencontainers/runc/exec.go +++ b/opencontainers/runc/exec.go @@ -31,7 +31,7 @@ following will output a list of processes running in the container: Flags: []cli.Flag{ cli.StringFlag{ Name: "console", - Usage: "specify the pty slave path for use with the container", + Usage: "specify the pty subordinate path for use with the container", }, cli.StringFlag{ Name: "cwd", diff --git a/opencontainers/runc/libcontainer/console.go b/opencontainers/runc/libcontainer/console.go index 042a2a2..df76676 100755 --- a/opencontainers/runc/libcontainer/console.go +++ b/opencontainers/runc/libcontainer/console.go @@ -7,9 +7,9 @@ type Console interface { io.ReadWriter io.Closer - // Path returns the filesystem path to the slave side of the pty. + // Path returns the filesystem path to the subordinate side of the pty. Path() string - // Fd returns the fd for the master of the pty. + // Fd returns the fd for the main of the pty. Fd() uintptr } diff --git a/opencontainers/runc/libcontainer/console_freebsd.go b/opencontainers/runc/libcontainer/console_freebsd.go index 300e34c..d3f21db 100755 --- a/opencontainers/runc/libcontainer/console_freebsd.go +++ b/opencontainers/runc/libcontainer/console_freebsd.go @@ -7,7 +7,7 @@ import ( ) // NewConsole returns an initialized console that can be used within a container by copying bytes -// from the master side to the slave that is attached as the tty for the container's init process. +// from the main side to the subordinate that is attached as the tty for the container's init process. func NewConsole(uid, gid int) (Console, error) { return nil, errors.New("libcontainer console is not supported on FreeBSD") } diff --git a/opencontainers/runc/libcontainer/console_linux.go b/opencontainers/runc/libcontainer/console_linux.go index 5c8769b..e2f7f0e 100755 --- a/opencontainers/runc/libcontainer/console_linux.go +++ b/opencontainers/runc/libcontainer/console_linux.go @@ -11,20 +11,20 @@ import ( ) // NewConsole returns an initialized console that can be used within a container by copying bytes -// from the master side to the slave that is attached as the tty for the container's init process. +// from the main side to the subordinate that is attached as the tty for the container's init process. func NewConsole(uid, gid int) (Console, error) { - master, err := os.OpenFile("/dev/ptmx", syscall.O_RDWR|syscall.O_NOCTTY|syscall.O_CLOEXEC, 0) + main, err := os.OpenFile("/dev/ptmx", syscall.O_RDWR|syscall.O_NOCTTY|syscall.O_CLOEXEC, 0) if err != nil { return nil, err } - if err := saneTerminal(master); err != nil { + if err := saneTerminal(main); err != nil { return nil, err } - console, err := ptsname(master) + console, err := ptsname(main) if err != nil { return nil, err } - if err := unlockpt(master); err != nil { + if err := unlockpt(main); err != nil { return nil, err } if err := os.Chmod(console, 0600); err != nil { @@ -34,43 +34,43 @@ func NewConsole(uid, gid int) (Console, error) { return nil, err } return &linuxConsole{ - slavePath: console, - master: master, + subordinatePath: console, + main: main, }, nil } // newConsoleFromPath is an internal function returning an initialized console for use inside // a container's MNT namespace. -func newConsoleFromPath(slavePath string) *linuxConsole { +func newConsoleFromPath(subordinatePath string) *linuxConsole { return &linuxConsole{ - slavePath: slavePath, + subordinatePath: subordinatePath, } } // linuxConsole is a linux pseudo TTY for use within a container. type linuxConsole struct { - master *os.File - slavePath string + main *os.File + subordinatePath string } func (c *linuxConsole) Fd() uintptr { - return c.master.Fd() + return c.main.Fd() } func (c *linuxConsole) Path() string { - return c.slavePath + return c.subordinatePath } func (c *linuxConsole) Read(b []byte) (int, error) { - return c.master.Read(b) + return c.main.Read(b) } func (c *linuxConsole) Write(b []byte) (int, error) { - return c.master.Write(b) + return c.main.Write(b) } func (c *linuxConsole) Close() error { - if m := c.master; m != nil { + if m := c.main; m != nil { return m.Close() } return nil @@ -81,7 +81,7 @@ func (c *linuxConsole) Close() error { func (c *linuxConsole) mount(rootfs, mountLabel string) error { oldMask := syscall.Umask(0000) defer syscall.Umask(oldMask) - if err := label.SetFileLabel(c.slavePath, mountLabel); err != nil { + if err := label.SetFileLabel(c.subordinatePath, mountLabel); err != nil { return err } dest := filepath.Join(rootfs, "/dev/console") @@ -92,17 +92,17 @@ func (c *linuxConsole) mount(rootfs, mountLabel string) error { if f != nil { f.Close() } - return syscall.Mount(c.slavePath, dest, "bind", syscall.MS_BIND, "") + return syscall.Mount(c.subordinatePath, dest, "bind", syscall.MS_BIND, "") } -// dupStdio opens the slavePath for the console and dups the fds to the current +// dupStdio opens the subordinatePath for the console and dups the fds to the current // processes stdio, fd 0,1,2. func (c *linuxConsole) dupStdio() error { - slave, err := c.open(syscall.O_RDWR) + subordinate, err := c.open(syscall.O_RDWR) if err != nil { return err } - fd := int(slave.Fd()) + fd := int(subordinate.Fd()) for _, i := range []int{0, 1, 2} { if err := syscall.Dup3(fd, i, 0); err != nil { return err @@ -111,17 +111,17 @@ func (c *linuxConsole) dupStdio() error { return nil } -// open is a clone of os.OpenFile without the O_CLOEXEC used to open the pty slave. +// open is a clone of os.OpenFile without the O_CLOEXEC used to open the pty subordinate. func (c *linuxConsole) open(flag int) (*os.File, error) { - r, e := syscall.Open(c.slavePath, flag, 0) + r, e := syscall.Open(c.subordinatePath, flag, 0) if e != nil { return nil, &os.PathError{ Op: "open", - Path: c.slavePath, + Path: c.subordinatePath, Err: e, } } - return os.NewFile(uintptr(r), c.slavePath), nil + return os.NewFile(uintptr(r), c.subordinatePath), nil } func ioctl(fd uintptr, flag, data uintptr) error { @@ -131,14 +131,14 @@ func ioctl(fd uintptr, flag, data uintptr) error { return nil } -// unlockpt unlocks the slave pseudoterminal device corresponding to the master pseudoterminal referred to by f. -// unlockpt should be called before opening the slave side of a pty. +// unlockpt unlocks the subordinate pseudoterminal device corresponding to the main pseudoterminal referred to by f. +// unlockpt should be called before opening the subordinate side of a pty. func unlockpt(f *os.File) error { var u int32 return ioctl(f.Fd(), syscall.TIOCSPTLCK, uintptr(unsafe.Pointer(&u))) } -// ptsname retrieves the name of the first available pts for the given master. +// ptsname retrieves the name of the first available pts for the given main. func ptsname(f *os.File) (string, error) { var n int32 if err := ioctl(f.Fd(), syscall.TIOCGPTN, uintptr(unsafe.Pointer(&n))); err != nil { diff --git a/opencontainers/runc/libcontainer/console_solaris.go b/opencontainers/runc/libcontainer/console_solaris.go index e90ca0d..c96009e 100755 --- a/opencontainers/runc/libcontainer/console_solaris.go +++ b/opencontainers/runc/libcontainer/console_solaris.go @@ -5,7 +5,7 @@ import ( ) // NewConsole returns an initialized console that can be used within a container by copying bytes -// from the master side to the slave that is attached as the tty for the container's init process. +// from the main side to the subordinate that is attached as the tty for the container's init process. func NewConsole(uid, gid int) (Console, error) { return nil, errors.New("libcontainer console is not supported on Solaris") } diff --git a/opencontainers/runc/libcontainer/criurpc/criurpc.pb.go b/opencontainers/runc/libcontainer/criurpc/criurpc.pb.go index 3c4fb77..c814e1d 100755 --- a/opencontainers/runc/libcontainer/criurpc/criurpc.pb.go +++ b/opencontainers/runc/libcontainer/criurpc/criurpc.pb.go @@ -319,7 +319,7 @@ type CriuOpts struct { InheritFd []*InheritFd `protobuf:"bytes,27,rep,name=inherit_fd" json:"inherit_fd,omitempty"` AutoExtMnt *bool `protobuf:"varint,28,opt,name=auto_ext_mnt" json:"auto_ext_mnt,omitempty"` ExtSharing *bool `protobuf:"varint,29,opt,name=ext_sharing" json:"ext_sharing,omitempty"` - ExtMasters *bool `protobuf:"varint,30,opt,name=ext_masters" json:"ext_masters,omitempty"` + ExtMains *bool `protobuf:"varint,30,opt,name=ext_mains" json:"ext_mains,omitempty"` SkipMnt []string `protobuf:"bytes,31,rep,name=skip_mnt" json:"skip_mnt,omitempty"` EnableFs []string `protobuf:"bytes,32,rep,name=enable_fs" json:"enable_fs,omitempty"` UnixSkIno []*UnixSk `protobuf:"bytes,33,rep,name=unix_sk_ino" json:"unix_sk_ino,omitempty"` @@ -543,9 +543,9 @@ func (m *CriuOpts) GetExtSharing() bool { return false } -func (m *CriuOpts) GetExtMasters() bool { - if m != nil && m.ExtMasters != nil { - return *m.ExtMasters +func (m *CriuOpts) GetExtMains() bool { + if m != nil && m.ExtMains != nil { + return *m.ExtMains } return false } diff --git a/opencontainers/runc/libcontainer/integration/exec_test.go b/opencontainers/runc/libcontainer/integration/exec_test.go index 2ba98d6..225e2da 100755 --- a/opencontainers/runc/libcontainer/integration/exec_test.go +++ b/opencontainers/runc/libcontainer/integration/exec_test.go @@ -1163,11 +1163,11 @@ func unmountOp(path string) error { return nil } -// Launch container with rootfsPropagation in rslave mode. Also +// Launch container with rootfsPropagation in rsubordinate mode. Also // bind mount a volume /mnt1host at /mnt1cont at the time of launch. Now do // another mount on host (/mnt1host/mnt2host) and this new mount should // propagate to container (/mnt1cont/mnt2host) -func TestRootfsPropagationSlaveMount(t *testing.T) { +func TestRootfsPropagationSubordinateMount(t *testing.T) { var mountPropagated bool var dir1cont string var dir2cont string @@ -1190,7 +1190,7 @@ func TestRootfsPropagationSlaveMount(t *testing.T) { defer os.RemoveAll(dir1host) // Make this dir a "shared" mount point. This will make sure a - // slave relationship can be established in container. + // subordinate relationship can be established in container. err = syscall.Mount(dir1host, dir1host, "bind", syscall.MS_BIND|syscall.MS_REC, "") ok(t, err) err = syscall.Mount("", dir1host, "", syscall.MS_SHARED|syscall.MS_REC, "") @@ -1206,7 +1206,7 @@ func TestRootfsPropagationSlaveMount(t *testing.T) { // TODO: systemd specific processing f := factory - container, err := f.Create("testSlaveMount", config) + container, err := f.Create("testSubordinateMount", config) ok(t, err) defer container.Destroy() diff --git a/opencontainers/runc/libcontainer/specconv/spec_linux.go b/opencontainers/runc/libcontainer/specconv/spec_linux.go index ff39f7d..9f5c7b2 100755 --- a/opencontainers/runc/libcontainer/specconv/spec_linux.go +++ b/opencontainers/runc/libcontainer/specconv/spec_linux.go @@ -32,8 +32,8 @@ var namespaceMapping = map[specs.NamespaceType]configs.NamespaceType{ var mountPropagationMapping = map[string]int{ "rprivate": syscall.MS_PRIVATE | syscall.MS_REC, "private": syscall.MS_PRIVATE, - "rslave": syscall.MS_SLAVE | syscall.MS_REC, - "slave": syscall.MS_SLAVE, + "rsubordinate": syscall.MS_SLAVE | syscall.MS_REC, + "subordinate": syscall.MS_SLAVE, "rshared": syscall.MS_SHARED | syscall.MS_REC, "shared": syscall.MS_SHARED, "": syscall.MS_PRIVATE | syscall.MS_REC, @@ -660,11 +660,11 @@ func parseMountOptions(options []string) (int, []int, string, int) { propagationFlags := map[string]int{ "private": syscall.MS_PRIVATE, "shared": syscall.MS_SHARED, - "slave": syscall.MS_SLAVE, + "subordinate": syscall.MS_SLAVE, "unbindable": syscall.MS_UNBINDABLE, "rprivate": syscall.MS_PRIVATE | syscall.MS_REC, "rshared": syscall.MS_SHARED | syscall.MS_REC, - "rslave": syscall.MS_SLAVE | syscall.MS_REC, + "rsubordinate": syscall.MS_SLAVE | syscall.MS_REC, "runbindable": syscall.MS_UNBINDABLE | syscall.MS_REC, } extensionFlags := map[string]struct { diff --git a/opencontainers/runc/run.go b/opencontainers/runc/run.go index 3eb63de..31ba726 100755 --- a/opencontainers/runc/run.go +++ b/opencontainers/runc/run.go @@ -34,7 +34,7 @@ command(s) that get executed on start, edit the args parameter of the spec. See cli.StringFlag{ Name: "console", Value: "", - Usage: "specify the pty slave path for use with the container", + Usage: "specify the pty subordinate path for use with the container", }, cli.BoolFlag{ Name: "detach, d",