Skip to content

Commit 0950c12

Browse files
author
Gabriel Saratura
committed
Fix naming
1 parent 436fe77 commit 0950c12

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

pkg/comp-functions/functions/common/maintenance/maintenance.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -515,15 +515,10 @@ func (m *Maintenance) createInitialMaintenanceJob(_ context.Context) error {
515515
// SetReleaseVersion sets the version from the claim if it's a new instance otherwise it is managed by maintenance function.
516516
// It will return the concrete observed version as well.
517517
// If the desired values contain a higher version than either the observed or the comp version, it will take precedence.
518-
//
519-
// If pinImageTag is set (non-empty):
520-
// - The exact pinned tag is used unconditionally
521-
// - Downgrades ARE allowed: the customer takes full responsibility
522-
// - No version comparison is performed
523518
func SetReleaseVersion(ctx context.Context, version string, desiredValues map[string]interface{}, observedValues map[string]interface{}, fields []string, pinImageTag string) (string, error) {
524519
l := controllerruntime.LoggerFrom(ctx)
525520

526-
// If an image tag is pinned, use it unconditionally (allow downgrades)
521+
// If an image tag is pinned, use it unconditionally, downgrades ARE allowed on user's own risk
527522
if pinImageTag != "" {
528523
l.Info("Using pinned image tag", "pinnedTag", pinImageTag)
529524
return pinImageTag, unstructured.SetNestedField(desiredValues, pinImageTag, fields...)

pkg/comp-functions/functions/vshnmariadb/backup.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ func AddBackupMariadb(ctx context.Context, comp *vshnv1.VSHNMariaDB, svc *runtim
2727
return runtime.NewFatalResult(fmt.Errorf("failed to parse composite: %w", err))
2828
}
2929

30-
// CurrentReleaseTag is being overriden in other functions
30+
// Setting the version may be lost in other functions, reinforce it here
31+
// TODO Fix status field being overwritten every time SetDesiredCompositeStatus() function is called
3132
if comp.Spec.Parameters.Maintenance.PinImageTag != "" {
3233
comp.Status.MariaDBVersion = comp.Spec.Parameters.Maintenance.PinImageTag
3334
}

pkg/comp-functions/functions/vshnmariadb/proxysql.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ func AddProxySQL(_ context.Context, comp *vshnv1.VSHNMariaDB, svc *runtime.Servi
9898
return runtime.NewWarningResult(fmt.Sprintf("cannot create PDB for ProxySQL: %s", err))
9999
}
100100

101-
// CurrentReleaseTag is being overriden in other functions
101+
// Setting the version may be lost in other functions, reinforce it here
102+
// TODO Fix status field being overwritten every time SetDesiredCompositeStatus() function is called
102103
if comp.Spec.Parameters.Maintenance.PinImageTag != "" {
103104
comp.Status.MariaDBVersion = comp.Spec.Parameters.Maintenance.PinImageTag
104105
}

pkg/comp-functions/functions/vshnredis/maintenance.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ func AddMaintenanceJob(ctx context.Context, comp *vshnv1.VSHNRedis, svc *runtime
1717
return runtime.NewFatalResult(fmt.Errorf("can't get composite: %w", err))
1818
}
1919

20-
// CurrentReleaseTag is being overriden in other functions
20+
// Setting the version may be lost in other functions, reinforce it here
21+
// TODO Fix status field being overwritten every time SetDesiredCompositeStatus() function is called
2122
if comp.Spec.Parameters.Maintenance.PinImageTag != "" {
2223
comp.Status.CurrentReleaseTag = comp.Spec.Parameters.Maintenance.PinImageTag
2324
}

0 commit comments

Comments
 (0)