Skip to content

Commit

Permalink
Added isolation on service update/create and compose files
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Ferquel <simon.ferquel@docker.com>
  • Loading branch information
simonferquel committed Aug 9, 2017
1 parent 4af6b5f commit cb0d4d7
Show file tree
Hide file tree
Showing 9 changed files with 184 additions and 120 deletions.
6 changes: 6 additions & 0 deletions cli/command/service/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,8 @@ type serviceOptions struct {
healthcheck healthCheckOptions
secrets opts.SecretOpt
configs opts.ConfigOpt

isolation string
}

func newServiceOptions() *serviceOptions {
Expand Down Expand Up @@ -614,6 +616,7 @@ func (options *serviceOptions) ToService(ctx context.Context, apiClient client.N
Hosts: convertExtraHostsToSwarmHosts(options.hosts.GetAll()),
StopGracePeriod: options.ToStopGracePeriod(flags),
Healthcheck: healthConfig,
Isolation: options.isolation,
},
Networks: networks,
Resources: options.resources.ToResourceRequirements(),
Expand Down Expand Up @@ -784,6 +787,8 @@ func addServiceFlags(flags *pflag.FlagSet, opts *serviceOptions, defaultFlagValu

flags.StringVar(&opts.stopSignal, flagStopSignal, "", "Signal to stop the container")
flags.SetAnnotation(flagStopSignal, "version", []string{"1.28"})
flags.StringVar(&opts.isolation, flagIsolation, "", "defines the isolation mode (hyperv, process)")
flags.SetAnnotation(flagIsolation, "version", []string{"1.32"})
}

const (
Expand Down Expand Up @@ -879,4 +884,5 @@ const (
flagConfig = "config"
flagConfigAdd = "config-add"
flagConfigRemove = "config-rm"
flagIsolation = "isolation"
)
1 change: 1 addition & 0 deletions cli/command/service/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ func updateService(ctx context.Context, apiClient client.NetworkAPIClient, flags
updateString(flagWorkdir, &cspec.Dir)
updateString(flagUser, &cspec.User)
updateString(flagHostname, &cspec.Hostname)
updateString(flagIsolation, &cspec.Isolation)
if err := updateMounts(flags, &cspec.Mounts); err != nil {
return err
}
Expand Down
1 change: 1 addition & 0 deletions cli/compose/convert/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ func Service(
Configs: configs,
ReadOnly: service.ReadOnly,
Privileges: &privileges,
Isolation: service.Isolation,
},
LogDriver: logDriver,
Resources: resources,
Expand Down
1 change: 1 addition & 0 deletions cli/compose/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ type ServiceConfig struct {
User string
Volumes []ServiceVolumeConfig
WorkingDir string `mapstructure:"working_dir"`
Isolation string `mapstructure:"isolation"`
}

// ShellCommand is a string or list of string args
Expand Down
4 changes: 2 additions & 2 deletions vendor.conf
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# docker

github.com/docker/docker d4f6db83c21cfc6af54fffb1f13e8acb7199f96a https://github.com/simonferquel/docker.git
github.com/docker/docker 2488cfa1ba00ee649c7ce07d4fd28c35c3ad9072 https://github.com/simonferquel/docker.git
github.com/docker/docker-credential-helpers v0.5.1
github.com/docker/distribution edc3ab29cdff8694dd6feb85cfeb4b5f1b38ed9c
github.com/docker/libnetwork 248fd5ea6a67f8810da322e6e7441e8de96a9045 https://github.com/dmcgowan/libnetwork.git
Expand All @@ -13,7 +13,7 @@ github.com/docker/go-events 9461782956ad83b30282bf90e31fa6a70c255ba9
github.com/docker/go-units 9e638d38cf6977a37a8ea0078f3ee75a7cdb2dd1
github.com/docker/libtrust 9cbd2a1374f46905c68a4eb3694a130610adc62a
github.com/docker/notary v0.4.2-sirupsen https://github.com/simonferquel/notary.git
github.com/docker/swarmkit 8bdecc57887ffc598b63d6433f58e0d2852112c3 https://github.com/dmcgowan/swarmkit.git
github.com/docker/swarmkit 0d860379bc362b5b93ca90ab465513ec2cd9a948 https://github.com/dmcgowan/swarmkit.git
github.com/moby/buildkit da2b9dc7dab99e824b2b1067ad7d0523e32dd2d9 https://github.com/dmcgowan/buildkit.git
github.com/stevvooe/continuity cd7a8e21e2b6f84799f5dd4b65faf49c8d3ee02d
github.com/tonistiigi/fsutil 0ac4c11b053b9c5c7c47558f81f96c7100ce50fb
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

283 changes: 165 additions & 118 deletions vendor/github.com/docker/swarmkit/api/specs.pb.go

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions vendor/github.com/docker/swarmkit/api/specs.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cb0d4d7

Please sign in to comment.