Skip to content

Commit 8947c3d

Browse files
authored
bump helm-operator-plugins to v0.3.0 (#1020)
- disable failure rollbacks - set max helm release history to 10 Signed-off-by: Joe Lanford <[email protected]>
1 parent feaeece commit 8947c3d

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

cmd/manager/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ func main() {
176176
os.Exit(1)
177177
}
178178

179-
acg, err := helmclient.NewActionClientGetter(cfgGetter)
179+
acg, err := helmclient.NewActionClientGetter(cfgGetter,
180+
helmclient.WithFailureRollbacks(false),
181+
)
180182
if err != nil {
181183
setupLog.Error(err, "unable to create helm client")
182184
os.Exit(1)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ require (
1111
github.com/google/go-cmp v0.6.0
1212
github.com/operator-framework/api v0.26.0
1313
github.com/operator-framework/catalogd v0.17.0
14-
github.com/operator-framework/helm-operator-plugins v0.2.2-0.20240520180534-f463c36fedf9
14+
github.com/operator-framework/helm-operator-plugins v0.3.0
1515
github.com/operator-framework/operator-registry v1.44.0
1616
github.com/operator-framework/rukpak v0.24.0
1717
github.com/spf13/pflag v1.0.5

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,8 +608,8 @@ github.com/operator-framework/api v0.26.0 h1:YVntU2NkVl5zSLLwK5kFcH6P3oSvN9QDgTs
608608
github.com/operator-framework/api v0.26.0/go.mod h1:3IxOwzVUeGxYlzfwKCcfCyS+q3EEhWA/4kv7UehbeyM=
609609
github.com/operator-framework/catalogd v0.17.0 h1:Vsl32qKf2nKbAnKNfJ6eREOkirx5+oxpUuSwMxGS/dc=
610610
github.com/operator-framework/catalogd v0.17.0/go.mod h1:7zVv39zlmvJvRePtRzdMRqn8s/WRH4ALXMJCKNQMKmc=
611-
github.com/operator-framework/helm-operator-plugins v0.2.2-0.20240520180534-f463c36fedf9 h1:f7/TMBpuIZEQ3JbD9UyP1L1ZCSLLWdR2aPN+A+dOHFY=
612-
github.com/operator-framework/helm-operator-plugins v0.2.2-0.20240520180534-f463c36fedf9/go.mod h1:ly6Bd9rSzmt37Wy6WtZHmA+IY9zG958MryJFLcVpCXw=
611+
github.com/operator-framework/helm-operator-plugins v0.3.0 h1:LNhcb5nPT/TAxZSsKH2LTYh79RgiN2twGFptQR96sRM=
612+
github.com/operator-framework/helm-operator-plugins v0.3.0/go.mod h1:ly6Bd9rSzmt37Wy6WtZHmA+IY9zG958MryJFLcVpCXw=
613613
github.com/operator-framework/operator-lib v0.14.0 h1:er+BgZymZD1im2wytLJiPLZpGALAX6N0gXaHx3PKbO4=
614614
github.com/operator-framework/operator-lib v0.14.0/go.mod h1:wUu4Xb9xzXnIpglvaZ3yucTMSlqGXHIoUEH9+5gWiu0=
615615
github.com/operator-framework/operator-registry v1.44.0 h1:NW5/xHYR77J2EUYm+6iBER1WNGLNS8gM+G5GBQWqTTs=

internal/controllers/clusterextension_controller.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ import (
7878
"github.com/operator-framework/operator-controller/internal/labels"
7979
)
8080

81+
const (
82+
maxHelmReleaseHistory = 10
83+
)
84+
8185
// ClusterExtensionReconciler reconciles a ClusterExtension object
8286
type ClusterExtensionReconciler struct {
8387
client.Client
@@ -363,6 +367,7 @@ func (r *ClusterExtensionReconciler) reconcile(ctx context.Context, ext *ocv1alp
363367
}
364368
case stateNeedsUpgrade:
365369
rel, err = ac.Upgrade(ext.GetName(), ext.Spec.InstallNamespace, chrt, values, func(upgrade *action.Upgrade) error {
370+
upgrade.MaxHistory = maxHelmReleaseHistory
366371
upgrade.Labels = map[string]string{labels.BundleNameKey: bundle.Name, labels.PackageNameKey: bundle.Package, labels.BundleVersionKey: bundleVersion.String()}
367372
return nil
368373
}, helmclient.AppendUpgradePostRenderer(post))
@@ -678,6 +683,7 @@ func (r *ClusterExtensionReconciler) getReleaseState(cl helmclient.ActionInterfa
678683
if errors.Is(err, driver.ErrReleaseNotFound) {
679684
desiredRelease, err := cl.Install(ext.GetName(), ext.Spec.InstallNamespace, chrt, values, func(i *action.Install) error {
680685
i.DryRun = true
686+
i.DryRunOption = "server"
681687
return nil
682688
}, helmclient.AppendInstallPostRenderer(post))
683689
if err != nil {
@@ -686,7 +692,9 @@ func (r *ClusterExtensionReconciler) getReleaseState(cl helmclient.ActionInterfa
686692
return nil, desiredRelease, stateNeedsInstall, nil
687693
}
688694
desiredRelease, err := cl.Upgrade(ext.GetName(), ext.Spec.InstallNamespace, chrt, values, func(upgrade *action.Upgrade) error {
695+
upgrade.MaxHistory = maxHelmReleaseHistory
689696
upgrade.DryRun = true
697+
upgrade.DryRunOption = "server"
690698
return nil
691699
}, helmclient.AppendUpgradePostRenderer(post))
692700
if err != nil {

0 commit comments

Comments
 (0)