From 9a9269fc83a5bc7df3f20ea2d680691f3a52528d Mon Sep 17 00:00:00 2001 From: David Kornel Date: Fri, 28 Jun 2024 10:41:49 +0200 Subject: [PATCH 1/3] Do not create olm namespace when exists Signed-off-by: David Kornel --- src/main/java/io/odh/test/install/OlmInstall.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/odh/test/install/OlmInstall.java b/src/main/java/io/odh/test/install/OlmInstall.java index ede4fe4..b59d11b 100644 --- a/src/main/java/io/odh/test/install/OlmInstall.java +++ b/src/main/java/io/odh/test/install/OlmInstall.java @@ -61,13 +61,15 @@ public void createManual() { * Creates namespace for operator-group and subscription */ private void createNamespace() { - // Create namespace at first because operator-group and subscription could you specific namespace - Namespace ns = new NamespaceBuilder() + if (!KubeResourceManager.getKubeClient().namespaceExists(namespace)) { + // Create namespace at first because operator-group and subscription could you specific namespace + Namespace ns = new NamespaceBuilder() .withNewMetadata() .withName(namespace) .endMetadata() .build(); - KubeResourceManager.getInstance().createOrUpdateResourceWithWait(ns); + KubeResourceManager.getInstance().createOrUpdateResourceWithWait(ns); + } } /** From 45af25e97fa4bff8d25deabf66a6ac17ca733ee9 Mon Sep 17 00:00:00 2001 From: David Kornel Date: Fri, 28 Jun 2024 10:48:26 +0200 Subject: [PATCH 2/3] address comments Signed-off-by: David Kornel --- src/main/java/io/odh/test/install/OlmInstall.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/odh/test/install/OlmInstall.java b/src/main/java/io/odh/test/install/OlmInstall.java index b59d11b..c746d27 100644 --- a/src/main/java/io/odh/test/install/OlmInstall.java +++ b/src/main/java/io/odh/test/install/OlmInstall.java @@ -68,7 +68,7 @@ private void createNamespace() { .withName(namespace) .endMetadata() .build(); - KubeResourceManager.getInstance().createOrUpdateResourceWithWait(ns); + KubeResourceManager.getInstance().createResourceWithoutWait(ns); } } From cf7790e0c760c2dcd2628cb3ed9de173345b773e Mon Sep 17 00:00:00 2001 From: David Kornel Date: Fri, 28 Jun 2024 10:49:02 +0200 Subject: [PATCH 3/3] address comments Signed-off-by: David Kornel --- src/main/java/io/odh/test/install/OlmInstall.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/odh/test/install/OlmInstall.java b/src/main/java/io/odh/test/install/OlmInstall.java index c746d27..aa76665 100644 --- a/src/main/java/io/odh/test/install/OlmInstall.java +++ b/src/main/java/io/odh/test/install/OlmInstall.java @@ -68,7 +68,7 @@ private void createNamespace() { .withName(namespace) .endMetadata() .build(); - KubeResourceManager.getInstance().createResourceWithoutWait(ns); + KubeResourceManager.getInstance().createResourceWithWait(ns); } }