projectcalico / calico

Cloud native networking and network security
https://docs.tigera.io/calico/latest/about/
Apache License 2.0
6.04k stars 1.35k forks source link

Tigera Operator Helm Chart 3.29.0 generates invalid tigera-operator-uninstall manifest #9434

Closed radekg closed 2 weeks ago

radekg commented 3 weeks ago
helm template projectcalico/tigera-operator --version 3.29.0

generates the following manifest for the tigera-operator-uninstall job:

# Source: tigera-operator/templates/tigera-operator/00-uninstall.yaml
apiVersion: batch/v1
kind: Job
metadata:
  name: tigera-operator-uninstall
  namespace: default
  labels:
    k8s-app: tigera-operator-uninstall
    helm.sh/chart: "tigera-operator-v3.29.0"
    k8s-app: tigera-operator
  annotations:
    # Mark this Job as a pre-deletion hook. This will only be executed as part
    # of helm uninstall, in order to ensure the Installation is cleaned up prior to
    # tearing down the operator.
    helm.sh/hook: pre-delete
    helm.sh/hook-weight: "-5"
    helm.sh/hook-delete-policy: hook-succeeded
spec:
  template:
    metadata:
      name: "release-name"
      labels:
        helm.sh/chart: "tigera-operator-v3.29.0"
    spec:
      nodeSelector:
        kubernetes.io/os: linux
      tolerations:
        - effect: NoExecute
          operator: Exists
        - effect: NoSchedule
          operator: Exists
      restartPolicy: Never
      hostNetwork: true
      dnsPolicy: ClusterFirstWithHostNet
      serviceAccountName: tigera-operator
      containers:
      - name: cleanup-job
        image: quay.io/tigera/operator:v1.36.0
        args: ["-pre-delete"]

.metadata.labels.k8s-app is generated twice.

Expected Behavior

There should be only one .metadata.labels.k8s-app.

Current Behavior

Possible Solution

I have no ideas.

Steps to Reproduce (for bugs)

With Helm and yq:

helm template projectcalico/tigera-operator --version 3.29.0 \
  | yq '. | select(.kind == "Job" and .metadata.name == "tigera-operator-uninstall")'

Context

irrelevant

Your Environment

irrelevant

caseydavenport commented 3 weeks ago

Thanks @radekg - this PR should fix it: https://github.com/projectcalico/calico/pull/9438

caseydavenport commented 2 weeks ago

Fixed and backported, should be in v3.29.1.

Thanks for raising this issue!

radekg commented 2 weeks ago

Nice, thank you. Glad I could help!