fix(labels): allow setting 'uncloud.' prefixed labels on services using a client but not CLI or Compose

This commit is contained in:
Pasha Sviderski
2026-11-04 13:51:53 +10:00
parent 78facdfcc6
commit 76b04dd56c
6 changed files with 93 additions and 9 deletions
+1 -1
View File
@@ -166,7 +166,7 @@ func (s *Service) InspectServiceContainer(ctx context.Context, nameOrID string)
// It applies the CPU and memory limits to the container and updates the service spec stored for the container.
func (s *Service) UpdateServiceContainer(ctx context.Context, id string, opts api.UpdateContainerOptions) error {
if opts.ServiceLabels != nil {
if err := api.ValidateLabels(*opts.ServiceLabels); err != nil {
if err := api.ValidateLabelKeys(*opts.ServiceLabels); err != nil {
return errdefs.ErrInvalidArgument.WithMessage(fmt.Sprintf("invalid service labels: %v", err))
}
}