Skip to content

Commit

Permalink
Always set (empty) UpdateStatus
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
thaJeztah committed Feb 9, 2019
1 parent cc6aa78 commit 4ecb32b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions manager/controlapi/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,9 +655,10 @@ func (s *Server) CreateService(ctx context.Context, request *api.CreateServiceRe
// TODO(aluzzardi): Consider using `Name` as a primary key to handle
// duplicate creations. See #65
service := &api.Service{
ID: identity.NewID(),
Spec: *request.Spec,
SpecVersion: &api.Version{},
ID: identity.NewID(),
Spec: *request.Spec,
SpecVersion: &api.Version{},
UpdateStatus: &api.UpdateStatus{},
}

if allocator.IsIngressNetworkNeeded(service) {
Expand Down

0 comments on commit 4ecb32b

Please sign in to comment.