Skip to content

ClusterSummary status doesn't surface Helm chart registration failures #1960

Description

@gianlucam76

What happens

When updateChartMap (in prepareForDeployment, clustersummary_controller.go) fails while registering a ClusterSummary's Helm charts with the chart manager, the error is only logged by the manager — it never reaches ClusterSummary.Status. The ClusterSummary sits with no featureSummaries entry for Helm at all (or a stale one), retrying silently forever with no indication anything is wrong.

Where

clustersummary_controller.go, in prepareForDeployment:

err = r.updateChartMap(ctx, clusterSummaryScope, logger)
if err != nil {
    if apierrors.IsNotFound(err) {
        // A required (non-optional) templateResourceRef is missing. Surface it as a
        // failure so the operator can see why deployment is blocked.
        r.setFailureMessage(clusterSummaryScope, err.Error())
        r.resetFeatureStatus(clusterSummaryScope, libsveltosv1beta1.FeatureStatusFailedNonRetriable)
    }
    r.setNextReconcileTime(clusterSummaryScope, normalRequeueAfter)
    return reconcile.Result{RequeueAfter: normalRequeueAfter}
}

Only the apierrors.IsNotFound case (a missing non-optional TemplateResourceRef) surfaces a failure via setFailureMessage/resetFeatureStatus. Every other error from updateChartMap — e.g. a Helm chart field that fails Sveltos template instantiation — falls through to a silent requeue. The error line does exist in the addon-controller pod logs (clustersummary_controller.go "failed to get instantiated charts"), but nothing looks at kubectl logs when a ClusterProfile appears to just do nothing; the natural place to check is kubectl get clustersummary -o yaml, which shows nothing at all.

Repro

  1. Apply a ClusterProfile whose helmCharts[].values isn't valid as a Sveltos template (e.g. contains {{ .Values.x }}, which .Values doesn't resolve to in the Sveltos template context).
  2. kubectl get clustersummary <name> -o yamlstatus shows only dependencies/nextReconcileTime, no featureSummaries, no failure message, indefinitely.
  3. kubectl logs -n projectsveltos deployment/addon-controller shows the real error, repeating every reconcile.

Expected

Any error from updateChartMap should surface on ClusterSummary.Status (failure message + appropriate feature status), the same way the apierrors.IsNotFound case already does, so a broken ClusterProfile is visible from kubectl get clustersummary alone.

🤖 Generated with Claude Code

https://claude.ai/code/session_017ni1qBbWHY224NZhMDZdGR

Activity

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

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