@@ -605,11 +605,11 @@ func RunRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
605
605
606
606
componentNames := getComponents (rt , opts )
607
607
608
- shouldRollback := opts .DisableRollback
608
+ disableRollback := opts .DisableRollback
609
609
610
610
defer func () {
611
611
// will rollback if err is not nil and it is safe to do so
612
- postInstallationHandler (ctx , opts , err , shouldRollback )
612
+ postInstallationHandler (ctx , opts , err , & disableRollback )
613
613
}()
614
614
615
615
token , iv , err := createRuntimeOnPlatform (ctx , & model.RuntimeInstallationArgs {
@@ -698,7 +698,7 @@ func RunRuntimeInstall(ctx context.Context, opts *RuntimeInstallOptions) error {
698
698
699
699
// if we got to this point the runtime was installed successfully
700
700
// thus we shall not perform a rollback after this point.
701
- shouldRollback = false
701
+ disableRollback = true
702
702
703
703
if store .Get ().SkipIngress {
704
704
handleCliStep (reporter .InstallStepCreateDefaultGitIntegration , "-skipped-" , err , false , true )
@@ -2245,8 +2245,8 @@ func inferAPIURLForGitProvider(provider apmodel.GitProviders) (string, error) {
2245
2245
return "" , fmt .Errorf ("cannot infer api-url for git provider %s, %s" , provider , suggest )
2246
2246
}
2247
2247
2248
- func postInstallationHandler (ctx context.Context , opts * RuntimeInstallOptions , err error , shouldRollback bool ) {
2249
- if err != nil && shouldRollback {
2248
+ func postInstallationHandler (ctx context.Context , opts * RuntimeInstallOptions , err error , disableRollback * bool ) {
2249
+ if err != nil && ! * disableRollback {
2250
2250
summaryArr = append (summaryArr , summaryLog {"----------Uninstalling runtime----------" , Info })
2251
2251
log .G (ctx ).Warnf ("installation failed due to error : %s, performing installation rollback" , err .Error ())
2252
2252
err := RunRuntimeUninstall (ctx , & RuntimeUninstallOptions {
0 commit comments