Просмотр исходного кода

Merge pull request #25070 from yongtang/24881-label-containers-with-stack-name

Label containers with stack name when deploying stack/bundle
Michael Crosby 9 лет назад
Родитель
Сommit
a86b2376a0
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      api/client/stack/deploy.go

+ 4 - 0
api/client/stack/deploy.go

@@ -168,6 +168,10 @@ func deployServices(
 					Command: service.Command,
 					Args:    service.Args,
 					Env:     service.Env,
+					// Service Labels will not be copied to Containers
+					// automatically during the deployment so we apply
+					// it here.
+					Labels: getStackLabels(namespace, nil),
 				},
 			},
 			EndpointSpec: &swarm.EndpointSpec{