Skip to content

Generated manifests have duplicate selector labels #125

@tico24

Description

@tico24

To recreate, in the operator-wandb directory run:

helm dependency update
helm template -s charts/app/templates/deployment.yaml . > out.yaml
cat out.yaml

The resulting yaml will have duplicate selector labels:

...
spec:
  replicas: 1
  selector:
    matchLabels:
      app.kubernetes.io/name: app
      app.kubernetes.io/instance: release-name
      helm.sh/chart: app-0.1.0
      app.kubernetes.io/name: app
      app.kubernetes.io/instance: release-name
      app.kubernetes.io/version: "0.33.0"
      wandb.com/app-name: app-0.1.0
      app.kubernetes.io/managed-by: Helm
...

Note app.kubernetes.io/name: app and app.kubernetes.io/instance: release-name are duplicated.

On the whole, kubernetes ignores the duplication. Kustomize is less nice and will throw errors along these lines:

error: map[string]interface {}(nil): yaml: unmarshal errors:
  line 20: mapping key "app.kubernetes.io/name" already defined at line 17
  line 21: mapping key "app.kubernetes.io/instance" already defined at line 18

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions