From f122d1a4cd039014da00d068b0a59c59c2602a24 Mon Sep 17 00:00:00 2001 From: David Kornel Date: Fri, 28 Jun 2024 10:51:07 +0200 Subject: [PATCH] Do not create olm namespace when exists (#150) 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..aa76665 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().createResourceWithWait(ns); + } } /**