From e265ffb853f34b77fb399f7b808abb89807e4100 Mon Sep 17 00:00:00 2001 From: Auri Munoz Date: Fri, 3 May 2024 12:43:29 +0200 Subject: [PATCH] add management policies --- .../main/java/io/halkyon/services/KubernetesClientService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/halkyon/services/KubernetesClientService.java b/app/src/main/java/io/halkyon/services/KubernetesClientService.java index 4f7133cb..df4ab06a 100644 --- a/app/src/main/java/io/halkyon/services/KubernetesClientService.java +++ b/app/src/main/java/io/halkyon/services/KubernetesClientService.java @@ -10,6 +10,7 @@ import java.util.Optional; import java.util.regex.Pattern; +import io.crossplane.helm.v1beta1.ReleaseSpec; import jakarta.enterprise.context.ApplicationScoped; import jakarta.transaction.Transactional; @@ -244,7 +245,7 @@ public void createCrossplaneHelmRelease(Cluster cluster, io.halkyon.model.Servic // Create Release object ReleaseBuilder release = new ReleaseBuilder(); release.withApiVersion("helm.crossplane.io").withKind("v1beta1").withNewMetadata().withName(service.helmChart) - .endMetadata().withNewSpec().withNewForProvider().addNewSet().withName("auth.database") + .endMetadata().withNewSpec().withManagementPolicies(ReleaseSpec.ManagementPolicies.CREATE).withNewForProvider().addNewSet().withName("auth.database") .withValue("fruits_database").endSet().addNewSet().withName("auth.username").withValue("healthy") .endSet().addNewSet().withName("auth.password").withValue("healthy").endSet() .withNamespace(service.namespace).withWait(true).withNewChart().withName(service.helmChart)