|
@@ -6,7 +6,7 @@ import (
|
|
"github.com/docker/docker/api/types"
|
|
"github.com/docker/docker/api/types"
|
|
"github.com/docker/docker/api/types/swarm"
|
|
"github.com/docker/docker/api/types/swarm"
|
|
"github.com/docker/docker/cli/command"
|
|
"github.com/docker/docker/cli/command"
|
|
- "github.com/docker/docker/pkg/composetransform"
|
|
|
|
|
|
+ "github.com/docker/docker/cli/compose/convert"
|
|
)
|
|
)
|
|
|
|
|
|
func deployBundle(ctx context.Context, dockerCli *command.DockerCli, opts deployOptions) error {
|
|
func deployBundle(ctx context.Context, dockerCli *command.DockerCli, opts deployOptions) error {
|
|
@@ -19,13 +19,13 @@ func deployBundle(ctx context.Context, dockerCli *command.DockerCli, opts deploy
|
|
return err
|
|
return err
|
|
}
|
|
}
|
|
|
|
|
|
- namespace := composetransform.NewNamespace(opts.namespace)
|
|
|
|
|
|
+ namespace := convert.NewNamespace(opts.namespace)
|
|
|
|
|
|
networks := make(map[string]types.NetworkCreate)
|
|
networks := make(map[string]types.NetworkCreate)
|
|
for _, service := range bundle.Services {
|
|
for _, service := range bundle.Services {
|
|
for _, networkName := range service.Networks {
|
|
for _, networkName := range service.Networks {
|
|
networks[networkName] = types.NetworkCreate{
|
|
networks[networkName] = types.NetworkCreate{
|
|
- Labels: composetransform.AddStackLabel(namespace, nil),
|
|
|
|
|
|
+ Labels: convert.AddStackLabel(namespace, nil),
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -53,7 +53,7 @@ func deployBundle(ctx context.Context, dockerCli *command.DockerCli, opts deploy
|
|
serviceSpec := swarm.ServiceSpec{
|
|
serviceSpec := swarm.ServiceSpec{
|
|
Annotations: swarm.Annotations{
|
|
Annotations: swarm.Annotations{
|
|
Name: name,
|
|
Name: name,
|
|
- Labels: composetransform.AddStackLabel(namespace, service.Labels),
|
|
|
|
|
|
+ Labels: convert.AddStackLabel(namespace, service.Labels),
|
|
},
|
|
},
|
|
TaskTemplate: swarm.TaskSpec{
|
|
TaskTemplate: swarm.TaskSpec{
|
|
ContainerSpec: swarm.ContainerSpec{
|
|
ContainerSpec: swarm.ContainerSpec{
|
|
@@ -64,7 +64,7 @@ func deployBundle(ctx context.Context, dockerCli *command.DockerCli, opts deploy
|
|
// Service Labels will not be copied to Containers
|
|
// Service Labels will not be copied to Containers
|
|
// automatically during the deployment so we apply
|
|
// automatically during the deployment so we apply
|
|
// it here.
|
|
// it here.
|
|
- Labels: composetransform.AddStackLabel(namespace, nil),
|
|
|
|
|
|
+ Labels: convert.AddStackLabel(namespace, nil),
|
|
},
|
|
},
|
|
},
|
|
},
|
|
EndpointSpec: &swarm.EndpointSpec{
|
|
EndpointSpec: &swarm.EndpointSpec{
|