Skip to content

Commit

Permalink
Do not create olm namespace when exists
Browse files Browse the repository at this point in the history
Signed-off-by: David Kornel <[email protected]>
  • Loading branch information
kornys committed Jun 28, 2024
1 parent 7c3ec64 commit 9a9269f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/io/odh/test/install/OlmInstall.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/**
Expand Down

0 comments on commit 9a9269f

Please sign in to comment.