Skip to content

Helm Chart Deployment breaks when updating labels #9357

@ehlertjd

Description

@ehlertjd

Actions before raising this issue

  • I searched the existing issues and did not find anything similar.
  • I read/searched the docs

Steps to Reproduce

  1. Deploy the CVAT helm chart
  2. Add a new label to the helm values file (e.g. under cvat.backend.labels)
  3. Try to deploy the updated helm chart

Observe errors trying to patch deployment (or statefulset) resources:

cannot patch "cvat-cvat-backend-server" with kind Deployment: Deployment.apps "cvat-cvat-backend-server" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app":"cvat-app", "app.kubernetes.io/instance":"cvat-cvat", "app.kubernetes.io/managed-by":"Helm", "app.kubernetes.io/name":"cvat", "app.kubernetes.io/version":"latest", "my-new-label":"value", "component":"server", "helm.sh/chart":"cvat", "tier":"backend"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable

Expected Behavior

The helm chart should deploy successfully, and deployments and statefulsets should be patched with the new labels.

Possible Solution

Use the selectorLabels macro for matchLabels instead of all applied podLabels

Context

No response

Environment

- CVAT 2.28.0 (but present in main)
- Kubernetes + Helm deployment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions