diff --git a/pkg/machinery/client/context.go b/pkg/machinery/client/context.go index 004f21c85d..5202075f47 100644 --- a/pkg/machinery/client/context.go +++ b/pkg/machinery/client/context.go @@ -13,7 +13,10 @@ import ( // WithNodes wraps the context with metadata to send request to set of nodes. func WithNodes(ctx context.Context, nodes ...string) context.Context { md, _ := metadata.FromOutgoingContext(ctx) - md = metadata.Join(md, metadata.MD{"nodes": nodes}) + + // overwrite any previous nodes in the context metadata with new value + md = md.Copy() + md.Set("nodes", nodes...) return metadata.NewOutgoingContext(ctx, md) }