Skip to content

Issues with helm charts post 2.2.3 upgrade #4964

Open
@varunthakur2480

Description

@varunthakur2480

Describe the bug

After upgrading to helm charts last week we started experiencing issues with helm charts, the error logs were full of these errors

apiserver received an error that is not an metav1.Status: &errors.errorString{s:"failed to prune fields: failed add back owned items: failed to convert merged object at version helm.toolkit.fluxcd.io/v2: .spec.chart.spec.valuesFile: field not declared in schema"}: failed to prune fields: failed add back owned items: failed to convert merged object at version helm.toolkit.fluxcd.io/v2: .spec.chart.spec.valuesFile: field

Its mentioned in release notes that The HelmRelease kind was promoted from v2beta2 to v2 (GA). However this should not have impacted us as we were still using the old version of API
source.toolkit.fluxcd.io/v1beta2
We had to rollback the release , another round of testing lead to same results so we had to change the .spec.chart.spec.valuesFile field to .spec.chart.spec.valuesFiles

Which fixed the errors , however that also resulted in some of the other errors which were not flagged by helmreleases api before the upgrade
eg
Helm upgrade failed for release dev2-e2-dev-xxxx-infra/redis-cluster-lb with chart [email protected]+2: cannot patch "redis-cluster-lb-headless" with kind Service: Service "redis-cluster-lb-headless" is invalid: spec.ports[1].name: Duplicate value: "tcp-redis" && cannot patch "redis-cluster-lb-0-svc" with kind Service: Service "redis-cluster-lb-0-svc" is invalid: spec.ports[1].name: Duplicate value: "tcp-redis" && cannot patch "redis-cluster-lb-1-svc" with kind Service: Service "redis-cluster-lb-1-svc" is invalid: spec.ports[1].name: Duplicate value: "tcp-redis" && cannot patch "redis-cluster-lb-2-svc" with kind Service: Service "redis-cluster-lb-2-svc" is invalid: spec.ports[1].name: Duplicate value: "tcp-redis" && cannot patch "redis-cluster-lb-3-svc" with kind Service: Service "redis-cluster-lb-3-svc" is invalid: spec.ports[1].name: Duplicate value: "tcp-redis" && cannot patch "redis-cluster-lb-4-svc" with kind Service: Service "redis-cluster-lb-4-svc" is invalid: spec.ports[1].name: Duplicate value: "tcp-redis" && cannot patch "redis-cluster-lb-5-svc" with kind Service: Service "redis-cluster-lb-5-svc" is invalid: spec.ports[1].name: Duplicate value: "tcp-redis" zipkin 7d18h True Helm upgrade succeeded for release dev2-e2-dev-xxx-infra/zipkin.v3 with chart [email protected]+2

This behaviour is not expected as we are using old version of the API any references to deprecated fields should still work on old api version

Steps to reproduce

Upgrade flux to v2.2.3 and deploy existing helmreleases which refer to old api version v1beta2
If the chart has reference to fields .spec.chart.spec.valuesFille, it starts throwing errors

Expected behavior

It is expected that the HelmReleases resource continues to work without issues after the upgrade if we are still on old version of the API i.e. v1Beta2

Screenshots and recordings

No response

OS / Distro

GKE container optimised OS

Flux version

flux: v2.2.3

Flux check

► checking prerequisites
✔ Kubernetes 1.29.7-gke.1008000 >=1.26.0-0
► checking version in cluster
✔ distribution: flux-v2.3.0
✔ bootstrapped: false
► checking controllers
✔ helm-controller: deployment ready
► gke-docker-releases.artifactory.platform.nwminfra.net/fluxcd/helm-controller:v1.0.1
✔ kustomize-controller: deployment ready
► gke-docker-releases.artifactory.platform.nwminfra.net/fluxcd/kustomize-controller:v1.3.0
✔ source-controller: deployment ready
► gke-docker-releases.artifactory.platform.nwminfra.net/fluxcd/source-controller:v1.3.0
► checking crds
✔ alerts.notification.toolkit.fluxcd.io/v1beta3
✔ buckets.source.toolkit.fluxcd.io/v1beta2
✔ gitrepositories.source.toolkit.fluxcd.io/v1
✔ helmcharts.source.toolkit.fluxcd.io/v1
✔ helmreleases.helm.toolkit.fluxcd.io/v2
✔ helmrepositories.source.toolkit.fluxcd.io/v1
✔ kustomizations.kustomize.toolkit.fluxcd.io/v1
✔ ocirepositories.source.toolkit.fluxcd.io/v1beta2
✔ providers.notification.toolkit.fluxcd.io/v1beta3
✔ receivers.notification.toolkit.fluxcd.io/v1
✔ all checks passed

Git provider

N/A

Container Registry provider

N/A

Additional context

N/A

Code of Conduct

  • I agree to follow this project's Code of Conduct

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