Docker Swarm API client has the following meta information for a service:
Meta.UpdatedAt
Is this the timestamp of last user-initiated update
(e.g. change service configuration) OR is it a timestamp of any change on service, that even Docker Swarm performs?
For example, if my swarm service has 5 tasks spread across cluster, and then Docker for some reason move one task from one node to another node (so the service configuration is NOT changed); would it update this field?
Short answer: No this won't.
If you look at the source code,
meta.UpdatedAt
is changed through thetouchMeta
method that is called byupdate
. For a service, the method handling this isUpdateService
, which is linked to thedocker service update
cli command. So technically,meta.UpdatedAt
is updated only when you usedocker service update
.You can test this quickly by following this scenario on your local machine or cluster:
The
meta.UpdatedAt
field should be left unchanged.Now call
docker service update redis --replicas 10
and you should see the new timestamp.