From 4dfad540aa8e3ab55d124dd4e566a3864dd96c95 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Sat, 25 Jul 2026 14:49:02 +0000 Subject: [PATCH] fix(deps): update github.com/moby/swarmkit/v2 digest to 28ad14b Signed-off-by: Mend Renovate --- go.mod | 2 +- go.sum | 4 ++-- vendor/github.com/moby/swarmkit/v2/agent/agent.go | 15 +++++++++++---- .../moby/swarmkit/v2/manager/orchestrator/task.go | 14 +++++++++++++- vendor/modules.txt | 2 +- 5 files changed, 28 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 7c87e62299..b6e478e2a6 100644 --- a/go.mod +++ b/go.mod @@ -74,7 +74,7 @@ require ( github.com/moby/profiles/apparmor v0.2.1 github.com/moby/profiles/seccomp v0.2.3 github.com/moby/pubsub v1.0.0 - github.com/moby/swarmkit/v2 v2.1.3-0.20260722161413-45ce3de76f2d + github.com/moby/swarmkit/v2 v2.1.3-0.20260725133749-28ad14b9eb35 github.com/moby/sys/atomicwriter v0.1.0 github.com/moby/sys/mount v0.3.5 github.com/moby/sys/mountinfo v0.7.2 diff --git a/go.sum b/go.sum index ccdaa2403c..40ebb98ff4 100644 --- a/go.sum +++ b/go.sum @@ -563,8 +563,8 @@ github.com/moby/profiles/seccomp v0.2.3 h1:nrHNSiECQQvq4WjgceCUgJXIXUJBIswVQ133k github.com/moby/profiles/seccomp v0.2.3/go.mod h1:8m3qkkWZXrRsMqlUUN2zyccnYmBf3EAdQYPMVJ3NBhk= github.com/moby/pubsub v1.0.0 h1:jkp/imWsmJz2f6LyFsk7EkVeN2HxR/HTTOY8kHrsxfA= github.com/moby/pubsub v1.0.0/go.mod h1:bXSO+3h5MNXXCaEG+6/NlAIk7MMZbySZlnB+cUQhKKc= -github.com/moby/swarmkit/v2 v2.1.3-0.20260722161413-45ce3de76f2d h1:+tUAgqagG7oOCzFbSd5WcoQbsGcbhRAbOBHy1TgBSME= -github.com/moby/swarmkit/v2 v2.1.3-0.20260722161413-45ce3de76f2d/go.mod h1:9rg8/RJeagBT8uRrsNFcetujUVZT/ynfya2hnabQY/A= +github.com/moby/swarmkit/v2 v2.1.3-0.20260725133749-28ad14b9eb35 h1:8D44vdVynl7eWS5XblHfyctMHcrzbLS4YSVcZBvjwKY= +github.com/moby/swarmkit/v2 v2.1.3-0.20260725133749-28ad14b9eb35/go.mod h1:9rg8/RJeagBT8uRrsNFcetujUVZT/ynfya2hnabQY/A= github.com/moby/sys/atomicwriter v0.1.0 h1:kw5D/EqkBwsBFi0ss9v1VG3wIkVhzGvLklJ+w3A14Sw= github.com/moby/sys/atomicwriter v0.1.0/go.mod h1:Ul8oqv2ZMNHOceF643P6FKPXeCmYtlQMvpizfsSoaWs= github.com/moby/sys/capability v0.4.0 h1:4D4mI6KlNtWMCM1Z/K0i7RV1FkX+DBDHKVJpCndZoHk= diff --git a/vendor/github.com/moby/swarmkit/v2/agent/agent.go b/vendor/github.com/moby/swarmkit/v2/agent/agent.go index 60df8a602c..cafbd0efa2 100644 --- a/vendor/github.com/moby/swarmkit/v2/agent/agent.go +++ b/vendor/github.com/moby/swarmkit/v2/agent/agent.go @@ -4,10 +4,10 @@ import ( "bytes" "context" "math/rand" - "reflect" "sync" "time" + "github.com/gogo/protobuf/proto" "github.com/moby/swarmkit/v2/agent/exec" "github.com/moby/swarmkit/v2/api" "github.com/moby/swarmkit/v2/log" @@ -249,7 +249,7 @@ func (a *Agent) run(ctx context.Context) { // if the node description has changed, update it to the new one // and close the session. The old session will be stopped and a // new one will be created with the updated description - if !reflect.DeepEqual(nodeDescription, newNodeDescription) { + if !nodeDescriptionsEqual(nodeDescription, newNodeDescription) { nodeDescription = newNodeDescription // close the session log.G(ctx).Info("agent: found node update") @@ -645,12 +645,19 @@ func (a *Agent) nodeDescriptionWithHostname(ctx context.Context, tlsInfo *api.No // nodesEqual returns true if the node states are functionally equal, ignoring status, // version and other superfluous fields. // -// This used to decide whether or not to propagate a node update to executor. +// This is used to decide whether to propagate a node update to the executor. func nodesEqual(a, b *api.Node) bool { a, b = a.Copy(), b.Copy() a.Status, b.Status = api.NodeStatus{}, api.NodeStatus{} a.Meta, b.Meta = api.Meta{}, api.Meta{} - return reflect.DeepEqual(a, b) + return proto.Equal(a, b) +} + +// nodeDescriptionsEqual reports whether two node descriptions are equal +// according to protobuf semantics, which treat nil and empty repeated fields +// as equivalent. +func nodeDescriptionsEqual(a, b *api.NodeDescription) bool { + return proto.Equal(a, b) } diff --git a/vendor/github.com/moby/swarmkit/v2/manager/orchestrator/task.go b/vendor/github.com/moby/swarmkit/v2/manager/orchestrator/task.go index 4f7bbdd33b..9549f67a94 100644 --- a/vendor/github.com/moby/swarmkit/v2/manager/orchestrator/task.go +++ b/vendor/github.com/moby/swarmkit/v2/manager/orchestrator/task.go @@ -8,6 +8,7 @@ import ( "github.com/moby/swarmkit/v2/api" "github.com/moby/swarmkit/v2/api/defaults" "github.com/moby/swarmkit/v2/identity" + "github.com/moby/swarmkit/v2/log" "github.com/moby/swarmkit/v2/manager/constraint" "github.com/moby/swarmkit/v2/protobuf/ptypes" ) @@ -119,7 +120,18 @@ func nodeMatches(s *api.Service, n *api.Node) bool { return false } - constraints, _ := constraint.Parse(s.Spec.Task.Placement.Constraints) + var pc []string + if s.Spec.Task.Placement != nil { + pc = s.Spec.Task.Placement.Constraints + } + + constraints, err := constraint.Parse(pc) + if err != nil { + log.L.WithFields(map[string]any{ + "error": err, + "constraints": pc, + }).Debug("IsTaskDirty: nodeMatches: failed to parse placement constraints") + } return constraint.NodeMatches(constraints, n) } diff --git a/vendor/modules.txt b/vendor/modules.txt index c5b1bb7909..9f29288da9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1331,7 +1331,7 @@ github.com/moby/profiles/seccomp # github.com/moby/pubsub v1.0.0 ## explicit; go 1.19 github.com/moby/pubsub -# github.com/moby/swarmkit/v2 v2.1.3-0.20260722161413-45ce3de76f2d +# github.com/moby/swarmkit/v2 v2.1.3-0.20260725133749-28ad14b9eb35 ## explicit; go 1.24.0 github.com/moby/swarmkit/v2/agent github.com/moby/swarmkit/v2/agent/configs