Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions controllers/handlers_helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -979,16 +979,22 @@ func walkChartsAndDeploy(ctx context.Context, c client.Client, clusterSummary *c
return releaseReports, chartDeployed, err
}

err = updateValueHashOnHelmChartSummary(ctx, instantiatedChart, clusterSummary, mgmtResources, logger)
valueHash, err := updateValueHashOnHelmChartSummary(ctx, instantiatedChart, clusterSummary, mgmtResources, logger)
if err != nil {
return releaseReports, chartDeployed, err
}

releaseReports = append(releaseReports, *report)

if currentRelease != nil {
logger.V(logs.LogInfo).Info(fmt.Sprintf("release %s/%s (version %s) status: %s",
currentRelease.ReleaseNamespace, currentRelease.ReleaseName, currentRelease.ChartVersion, currentRelease.Status))
if valueHash != nil {
logger.V(logs.LogInfo).Info(fmt.Sprintf("release %s/%s (version %s) (value hash %x) status: %s",
currentRelease.ReleaseNamespace, currentRelease.ReleaseName, currentRelease.ChartVersion,
valueHash, currentRelease.Status))
} else {
logger.V(logs.LogInfo).Info(fmt.Sprintf("release %s/%s (version %s) status: %s",
currentRelease.ReleaseNamespace, currentRelease.ReleaseName, currentRelease.ChartVersion, currentRelease.Status))
}
if currentRelease.Status == release.StatusDeployed.String() {
// Deployed chart is used for updating ClusterConfiguration. There is no ClusterConfiguration for mgmt cluster
chartDeployed = append(chartDeployed, configv1beta1.Chart{
Expand Down Expand Up @@ -3573,13 +3579,13 @@ func getHelmChartValuesHash(ctx context.Context, c client.Client, instantiatedCh

func updateValueHashOnHelmChartSummary(ctx context.Context, requestedChart *configv1beta1.HelmChart,
clusterSummary *configv1beta1.ClusterSummary, mgmtResources map[string]*unstructured.Unstructured,
logger logr.Logger) error {
logger logr.Logger) ([]byte, error) {

c := getManagementClusterClient()

helmChartValuesHash, err := getHelmChartValuesHash(ctx, c, requestedChart, clusterSummary, mgmtResources, logger)
if err != nil {
return err
return nil, err
}

err = retry.RetryOnConflict(retry.DefaultRetry, func() error {
Expand All @@ -3602,7 +3608,7 @@ func updateValueHashOnHelmChartSummary(ctx context.Context, requestedChart *conf
return c.Status().Update(ctx, currentClusterSummary)
})

return err
return helmChartValuesHash, err
}

// getValueHashFromHelmChartSummary returns the valueHash stored for this chart
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/onsi/ginkgo/v2 v2.28.1
github.com/onsi/gomega v1.39.1
github.com/pkg/errors v0.9.1
github.com/projectsveltos/libsveltos v1.4.1-0.20260130204733-fe2b5557bc98
github.com/projectsveltos/libsveltos v1.4.1-0.20260131124754-dd6ff263bbb9
github.com/prometheus/client_golang v1.23.2
github.com/robfig/cron v1.2.0
github.com/spf13/pflag v1.0.10
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/poy/onpar v1.1.2 h1:QaNrNiZx0+Nar5dLgTVp5mXkyoVFIbepjyEoGSnhbAY=
github.com/poy/onpar v1.1.2/go.mod h1:6X8FLNoxyr9kkmnlqpK6LSoiOtrO6MICtWwEuWkLjzg=
github.com/projectsveltos/libsveltos v1.4.1-0.20260130204733-fe2b5557bc98 h1:EWYha0rddaGcVbAgVrAltyBsq4EHkMDaK8zPYzaJZCo=
github.com/projectsveltos/libsveltos v1.4.1-0.20260130204733-fe2b5557bc98/go.mod h1:Zr20iLkXujukoB9x1zjmYVULonScKUu1d7XIMU3Z5tU=
github.com/projectsveltos/libsveltos v1.4.1-0.20260131124754-dd6ff263bbb9 h1:5ldqgGt5IAg/HNZlzom6/WCugQfUIRheCdxjwmpq6ds=
github.com/projectsveltos/libsveltos v1.4.1-0.20260131124754-dd6ff263bbb9/go.mod h1:Zr20iLkXujukoB9x1zjmYVULonScKUu1d7XIMU3Z5tU=
github.com/projectsveltos/lua-utils/glua-json v0.0.0-20251212200258-2b3cdcb7c0f5 h1:khnc+994UszxZYu69J+R5FKiLA/Nk1JQj0EYAkwTWz0=
github.com/projectsveltos/lua-utils/glua-json v0.0.0-20251212200258-2b3cdcb7c0f5/go.mod h1:yVL8KQFa9tmcxgwl9nwIMtKgtmIVC1zaFRSCfOwYvPY=
github.com/projectsveltos/lua-utils/glua-runes v0.0.0-20251212200258-2b3cdcb7c0f5 h1:YbsebwRwTRhV8QacvEAdFqxcxHdeu7JTVtsBovbkgos=
Expand Down