rancher: [BUG] Wrangler show error state for HelmChart

Rancher Server Setup

  • Rancher version: v2.9.3
  • Installation option (Docker install/Helm Chart): Docker

Information about the Cluster

  • Kubernetes version: v1.30.7+rke2r1
  • Cluster Type (Local/Downstream): Downstream
    • If downstream, what type of cluster? Hosted = Harvester

User Information

  • What is the role of the user logged in? Admin

Describe the bug In k3s helm controller, it introduced Failed condition (https://github.com/k3s-io/helm-controller/blob/b40937ee695b33e80df2bbf4fa3437c8b9bce08d/pkg/apis/helm.cattle.io/v1/types.go#L73).

In wrangler, it checks whether an object is error by checking Failed condition with False status.

https://github.com/rancher/wrangler/blob/abb0081704f3a7af13bf537a281937dadc0e6baa/pkg/summary/summarizers.go#L221-L235

https://github.com/rancher/wrangler/blob/abb0081704f3a7af13bf537a281937dadc0e6baa/pkg/summary/summarizers.go#L81-L83

Finally, dashboard shows Error for all HelmChart.

To Reproduce

  1. Create Rancher v2.9.3.
  2. Import Harvester.
  3. Create a guest cluster.

Result Check HelmCharts board in guest cluster. Every HelmChart has error state.

Expected Result The HelmChart without error should not show any error state.

Screenshots Screenshot 2024-12-31 at 4 05 06 PM

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 16 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Investigation Results

For this analysis I’ve reviewed code from rancher/wrangler and k3s/helm-controller and found out that:

The only place in k3s/helm-controller generates the combination of a HelmChartCondition with type=Failed and status=False is in: pkg/controller/chart/chart.go: L248-260

And it doesn’t seem to represent an error. There are other places before this one where errors are clearly being handled and the status is always True as can be seen here:

And here:

  • pkg/controller/chart/chart.go: 230-242 - In this one, the line just above the conditions population is returning an error and we check if this error is not null and populate the Status=True clearly indicating an error.

Next Steps

I would suggest we review the line pkg/summary/summarizers.go: 223 in wrangler and change it to only consider Type=Failed and Status=True as errors.

Also this error looks like the same we have in SURE-9401. So it would probably resolve that issue too.

@tomleb and I had a meeting yesterday and we’ve decided to implement a “per-resource” condition analysis map. The goal is to map all the condition we can find and attach those to a map indicating if these represent errors or not and for conditions not found in map we’ll keep the previous logic.