Skip to content

Commit 609d685

Browse files
authored
Merge pull request #1600 from gianlucam76/worker
Advance libsveltos
2 parents 4322a88 + 24673fd commit 609d685

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

controllers/handlers_helm.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -979,16 +979,22 @@ func walkChartsAndDeploy(ctx context.Context, c client.Client, clusterSummary *c
979979
return releaseReports, chartDeployed, err
980980
}
981981

982-
err = updateValueHashOnHelmChartSummary(ctx, instantiatedChart, clusterSummary, mgmtResources, logger)
982+
valueHash, err := updateValueHashOnHelmChartSummary(ctx, instantiatedChart, clusterSummary, mgmtResources, logger)
983983
if err != nil {
984984
return releaseReports, chartDeployed, err
985985
}
986986

987987
releaseReports = append(releaseReports, *report)
988988

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

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

35783584
c := getManagementClusterClient()
35793585

35803586
helmChartValuesHash, err := getHelmChartValuesHash(ctx, c, requestedChart, clusterSummary, mgmtResources, logger)
35813587
if err != nil {
3582-
return err
3588+
return nil, err
35833589
}
35843590

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

3605-
return err
3611+
return helmChartValuesHash, err
36063612
}
36073613

36083614
// getValueHashFromHelmChartSummary returns the valueHash stored for this chart

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ require (
1818
github.com/onsi/ginkgo/v2 v2.28.1
1919
github.com/onsi/gomega v1.39.1
2020
github.com/pkg/errors v0.9.1
21-
github.com/projectsveltos/libsveltos v1.4.1-0.20260130204733-fe2b5557bc98
21+
github.com/projectsveltos/libsveltos v1.4.1-0.20260131124754-dd6ff263bbb9
2222
github.com/prometheus/client_golang v1.23.2
2323
github.com/robfig/cron v1.2.0
2424
github.com/spf13/pflag v1.0.10

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRI
279279
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
280280
github.com/poy/onpar v1.1.2 h1:QaNrNiZx0+Nar5dLgTVp5mXkyoVFIbepjyEoGSnhbAY=
281281
github.com/poy/onpar v1.1.2/go.mod h1:6X8FLNoxyr9kkmnlqpK6LSoiOtrO6MICtWwEuWkLjzg=
282-
github.com/projectsveltos/libsveltos v1.4.1-0.20260130204733-fe2b5557bc98 h1:EWYha0rddaGcVbAgVrAltyBsq4EHkMDaK8zPYzaJZCo=
283-
github.com/projectsveltos/libsveltos v1.4.1-0.20260130204733-fe2b5557bc98/go.mod h1:Zr20iLkXujukoB9x1zjmYVULonScKUu1d7XIMU3Z5tU=
282+
github.com/projectsveltos/libsveltos v1.4.1-0.20260131124754-dd6ff263bbb9 h1:5ldqgGt5IAg/HNZlzom6/WCugQfUIRheCdxjwmpq6ds=
283+
github.com/projectsveltos/libsveltos v1.4.1-0.20260131124754-dd6ff263bbb9/go.mod h1:Zr20iLkXujukoB9x1zjmYVULonScKUu1d7XIMU3Z5tU=
284284
github.com/projectsveltos/lua-utils/glua-json v0.0.0-20251212200258-2b3cdcb7c0f5 h1:khnc+994UszxZYu69J+R5FKiLA/Nk1JQj0EYAkwTWz0=
285285
github.com/projectsveltos/lua-utils/glua-json v0.0.0-20251212200258-2b3cdcb7c0f5/go.mod h1:yVL8KQFa9tmcxgwl9nwIMtKgtmIVC1zaFRSCfOwYvPY=
286286
github.com/projectsveltos/lua-utils/glua-runes v0.0.0-20251212200258-2b3cdcb7c0f5 h1:YbsebwRwTRhV8QacvEAdFqxcxHdeu7JTVtsBovbkgos=

0 commit comments

Comments
 (0)