Skip to content

Conversation

@gianlucam76
Copy link
Member

With sync mode ContinuousWithDriftDetection, if an Helm chart contained corev1.List objects, this will cause deployment to fail.

This PR fixes that by expanding what is containing in corev1.List.

Fixes #1136

@gianlucam76
Copy link
Member Author

Tried with

apiVersion: config.projectsveltos.io/v1beta1
kind: ClusterProfile
metadata:
  name: kube-prometheus-stack
spec:
  dependsOn:
  clusterSelector:
    matchLabels:
      env: fv
  syncMode: ContinuousWithDriftDetection
  helmCharts:
  - repositoryURL:    https://prometheus-community.github.io/helm-charts
    repositoryName:   prometheus-community
    chartName:        prometheus-community/kube-prometheus-stack
    chartVersion:     70.3.0
    releaseName:      kube-prometheus-stack
    releaseNamespace: kube-prometheus-stack
    helmChartAction:  Install
    values: |
      grafana:
          enabled: true
      alertmanager:
          enabled: false
      kubeEtcd:
          service: {}
          serviceMonitor: {}
      prometheus:
          prometheusSpec:
              serviceMonitorSelectorNilUsesHelmValues: false
              serviceMonitorNamespaceSelector:
                  matchExpressions:
                      - key: kubernetes.io/metadata.name
                        operator: Exists
          additionalServiceMonitors:
              - name: k0s
                selector:
                  matchLabels:
                      app: k0s-observability
                      component: pushgateway
                      k0s.k0sproject.io/stack: metrics
                namespaceSelector:
                  matchNames:
                      - k0s-system
                endpoints:
                  - port: http
                    metricRelabelings:
                      - sourceLabels:
                          - exported_job
                        targetLabel: job
      kubelet:
          serviceMonitor:
              cAdvisor: true

and before the fix could see the failure message reported in the bug.
After fix

  status:
    dependencies: no dependencies
    featureSummaries:
    - featureID: Helm
      hash: 5D/ftd1+ny6b9oaWgc/nKqZddPGdWmhxhPnby27dbNc=
      lastAppliedTime: "2025-04-14T14:40:04Z"
      status: Provisioned

With sync mode ContinuousWithDriftDetection, if an Helm chart contained
corev1.List objects, this will cause deployment to fail.

This PR fixes that by expanding what is containing in corev1.List.
@gianlucam76 gianlucam76 merged commit 0aadd0a into projectsveltos:main Apr 14, 2025
6 checks passed
@gianlucam76 gianlucam76 deleted the helm-list branch April 14, 2025 17:33
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: Drift detection manager doesn't handle List objects correctly in helm charts for ResourceSummary

2 participants