Skip to content

(bug) Enhance Helm Dependency Resolution and Metadata Validation#1641

Merged
gianlucam76 merged 1 commit intoprojectsveltos:mainfrom
gianlucam76:helm-fix
Mar 10, 2026
Merged

(bug) Enhance Helm Dependency Resolution and Metadata Validation#1641
gianlucam76 merged 1 commit intoprojectsveltos:mainfrom
gianlucam76:helm-fix

Conversation

@gianlucam76
Copy link
Member

This PR addresses issues where Helm releases would fail or get stuck due to missing sub-charts or invalid semantic versioning metadata during the upgrade lifecycle. It introduces a more robust dependency management flow and sanitizes chart metadata to prevent "invalid semantic version" errors.

Fixes #1631

@gianlucam76
Copy link
Member Author

Started with

apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
  labels:
    test-deployment: "true"
  name: prometheus-27-1-0
  namespace: default
spec:
  interval: 0s
  ref:
    tag: kube-prometheus-stack-27.1.0
  timeout: 1m0s
  url: https://github.com/prometheus-community/helm-charts.git
---
apiVersion: config.projectsveltos.io/v1beta1
kind: ClusterProfile
metadata:
  name: test-profile
spec:
  clusterRefs:
  - apiVersion: lib.projectsveltos.io/v1beta1
    kind: SveltosCluster
    name: mgmt
    namespace: mgmt
  clusterSelector: {}
  continueOnConflict: false
  continueOnError: true
  helmCharts:
  - helmChartAction: Install
    releaseName: test-prometheus
    releaseNamespace: monitoring
    repositoryURL: GitRepository://default/prometheus-27-1-0/charts/prometheus
    values: |
      server:
        replicaCount: one
  reloader: false
  stopMatchingBehavior: WithdrawPolicies
  syncMode: Continuous

because of incorrect values ClusterSummary goes to failed state

  status:
    dependencies: no dependencies
    featureSummaries:
    - consecutiveFailures: 2
      failureMessage: |
        chart: , release: test-prometheus, failed to create resource: Deployment in version "v1" cannot be handled as a Deployment: json: cannot unmarshal string into Go struct field DeploymentSpec.spec.replicas of type int32
      featureID: Helm
      hash: L9feSuJgfU70RytYjSMeG5q1g8yYidQ6ArmW7ilaTF4=
      lastAppliedTime: "2026-03-10T18:29:12Z"
      status: Failed
    helmReleaseSummaries:
    - releaseName: test-prometheus
      releaseNamespace: monitoring
      status: Managing

fix the values

values: "server:\n  replicaCount: 1 \n"

ClusterSummary gets provisioned

  status:
    dependencies: no dependencies
    featureSummaries:
    - featureID: Helm
      hash: fd+1+Z4b5s1U4XaJQllKSOPg5Nin6eOXlz7B2If/tn8=
      lastAppliedTime: "2026-03-10T18:30:11Z"
      status: Provisioned

This PR addresses issues where Helm releases would fail or get stuck due
to missing sub-charts or invalid semantic versioning metadata during the
upgrade lifecycle. It introduces a more robust dependency management flow
and sanitizes chart metadata to prevent "invalid semantic version" errors.
@gianlucam76 gianlucam76 merged commit fbe53f4 into projectsveltos:main Mar 10, 2026
8 checks passed
@gianlucam76 gianlucam76 deleted the helm-fix branch March 10, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: helm values update in Profile/ClusterProfile does not cause the helm chart re-deploy

1 participant