From 9a9269fc83a5bc7df3f20ea2d680691f3a52528d Mon Sep 17 00:00:00 2001 From: David Kornel Date: Fri, 28 Jun 2024 10:41:49 +0200 Subject: [PATCH] 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); + } } /**