Skip to content

Commit 96f1b6e

Browse files
committed
Always set (empty) UpdateStatus
When deploying a service the `UpdateStatus.State` field is not present during `docker service create`. This complicates creating scripts that check for `UpdateStatus.State` to reach a certain state, as they have to take into account that the `UpdateStatus` as a whole is missing. This patch always sets the `UpdateStatus.State` to make it easier to consume. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent d6592dd commit 96f1b6e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

manager/controlapi/service.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -730,9 +730,10 @@ func (s *Server) CreateService(ctx context.Context, request *api.CreateServiceRe
730730
// TODO(aluzzardi): Consider using `Name` as a primary key to handle
731731
// duplicate creations. See #65
732732
service := &api.Service{
733-
ID: identity.NewID(),
734-
Spec: *request.Spec,
735-
SpecVersion: &api.Version{},
733+
ID: identity.NewID(),
734+
Spec: *request.Spec,
735+
SpecVersion: &api.Version{},
736+
UpdateStatus: &api.UpdateStatus{},
736737
}
737738

738739
if isJobSpec(request.Spec) {

0 commit comments

Comments
 (0)