Skip to content

Commit 6b39796

Browse files
committed
fix: return error if not notfound
1 parent 79a6dca commit 6b39796

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

api/lagoon/v1beta2/lagoonbuild_helpers.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,9 @@ func GetOrCreateNamespace(ctx context.Context,
829829

830830
// if kubernetes, just create it if it doesn't exist
831831
if err := cl.Get(ctx, types.NamespacedName{Name: ns}, namespace); err != nil {
832+
if helpers.IgnoreNotFound(err) != nil {
833+
return true, fmt.Errorf("there was an error getting the namespace: Error was: %v", err)
834+
}
832835
if err := cl.Create(ctx, namespace); err != nil {
833836
return true, fmt.Errorf("there was an error creating the namespace. Error was: %v", err)
834837
}

0 commit comments

Comments
 (0)