Skip to content

Fix for: zrok & ziti-router helm charts. Remove duplicated already defined labels#303

Merged
qrkourier merged 2 commits intoopenziti:mainfrom
qdrddr:main
Feb 12, 2025
Merged

Fix for: zrok & ziti-router helm charts. Remove duplicated already defined labels#303
qrkourier merged 2 commits intoopenziti:mainfrom
qdrddr:main

Conversation

@qdrddr
Copy link
Contributor

@qdrddr qdrddr commented Feb 12, 2025

  • zrok
  • ziti-router

Remove from spec.template.metadata.labels duplicated already defined labels:

  • app.kubernetes.io/managed-by
  • app.kubernetes.io/instance
  • helm.sh/chart

So it would not prevent deploying these helm charts, otherwise you can see error "unmarshal errors [...] mapping key [...] already defined"

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
helmCharts:
  - name: zrok
    repo: https://docs.openziti.io/helm-charts/
#    version: 0.2.7
    version: 0.2.7
    releaseName: zrok
    namespace: openziti-system
    valuesFile: zrok-values.yaml
    includeCRDs: true

  - name: ziti-router
    repo: https://docs.openziti.io/helm-charts/
#    version: 1.1.7
    version: 1.1.7
    releaseName: ziti-router
    namespace: openziti-system
    valuesFile: ziti-router-values.yaml
    includeCRDs: true

If not fixed, you'll get:

kustomize build ./kustomizations --enable-helm > ./openziti.kustimized.yaml
Error: map[string]interface {}(nil): yaml: unmarshal errors:
  line 27: mapping key "app.kubernetes.io/managed-by" already defined at line 22
  line 29: mapping key "app.kubernetes.io/instance" already defined at line 23
  line 25: mapping key "helm.sh/chart" already defined at line 24

If I manually remove the duplicated lebels from spec.template.metadata.labels when I inflate the helm chart the resulting manifest will have spec.template.metadata.labels set inherited from the helm chart, confirming that setting them in the template is unneccessary.

- zrok
- ziti-router

Remove from spec.template.metadata.labels duplicated already defined labels:
- app.kubernetes.io/managed-by
- app.kubernetes.io/instance
- helm.sh/chart

So it would not prevent deploying these helm charts, otherwise you can see error "unmarshal errors [...] mapping key [...] already defined"

```shell
kustomize build ./kustomizations --enable-helm > ./openziti.kustimized.yaml
Error: map[string]interface {}(nil): yaml: unmarshal errors:
  line 27: mapping key "app.kubernetes.io/managed-by" already defined at line 22
  line 29: mapping key "app.kubernetes.io/instance" already defined at line 23
  line 25: mapping key "helm.sh/chart" already defined at line 24
```
Copy link
Member

@qrkourier qrkourier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thank you for sharing your rationale and for the patch!

@qrkourier qrkourier merged commit 9de7a7e into openziti:main Feb 12, 2025
3 checks passed
@qdrddr
Copy link
Contributor Author

qdrddr commented Feb 12, 2025

@qrkourier which versions of zrok & ziti-router helm charts will this be merged to?
the same or the next? And when it will be ready? Thanks

Current versions are:

  • zrok 0.2.7
  • ziti-router 1.1.7

@qrkourier
Copy link
Member

qrkourier commented Feb 12, 2025

These changes are now in latest: https://github.com/openziti/helm-charts/releases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants