From bea2a0cb607e1946b5068644d29540f9b74a9ba8 Mon Sep 17 00:00:00 2001 From: erikzaadi Date: Tue, 10 Dec 2024 14:58:35 +0200 Subject: [PATCH] Enable multiple installations by not failing if all existing default resources exists --- pkg/defaults/defaults.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/defaults/defaults.go b/pkg/defaults/defaults.go index 87ceffb..fd02d22 100644 --- a/pkg/defaults/defaults.go +++ b/pkg/defaults/defaults.go @@ -146,9 +146,7 @@ func validateResourcesDoesNotExist(portClient *cli.PortClient, defaults *Default var errors []error if _, err := integration.GetIntegration(portClient, config.StateKey); err == nil { klog.Warningf("Integration with state key %s already exists", config.StateKey) - return &AbortDefaultCreationError{Errors: []error{ - fmt.Errorf("integration with state key %s already exists", config.StateKey), - }} + errors = append(errors, fmt.Errorf("integration with state key %s already exists", config.StateKey)) } for _, bp := range defaults.Blueprints { @@ -165,7 +163,7 @@ func validateResourcesDoesNotExist(portClient *cli.PortClient, defaults *Default } } - if errors != nil { + if errors != nil && len(errors) != 3 { return &AbortDefaultCreationError{Errors: errors} } return nil