From 88e97bc0476fa23ebf8ed251f3859e0c4576ffc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Tue, 5 Dec 2023 10:31:16 +0100 Subject: [PATCH] filtering fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- .../operatorsdk/deployment/helm/HelmChartProcessor.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/helm/HelmChartProcessor.java b/core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/helm/HelmChartProcessor.java index 8587d4cf0..e8c1fd0b4 100644 --- a/core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/helm/HelmChartProcessor.java +++ b/core/deployment/src/main/java/io/quarkiverse/operatorsdk/deployment/helm/HelmChartProcessor.java @@ -108,15 +108,14 @@ private void addExplicitlyAddedKubernetesResources(File helmDir, private List filterOutStandardResources(List list, ApplicationInfoBuildItem appInfo) { return list.stream().filter(r -> { if (r instanceof ClusterRole) { - return !r.getMetadata().getName().equals("simple-cluster-role") && - !r.getMetadata().getName().equals("josdk-crd-validating-cluster-role"); + return !r.getMetadata().getName().endsWith("-cluster-role"); } if (r instanceof ClusterRoleBinding) { - return !r.getMetadata().getName().equals("simple-crd-validating-role-binding"); + return !r.getMetadata().getName().endsWith("-crd-validating-role-binding"); } if (r instanceof RoleBinding) { return !r.getMetadata().getName().equals(appInfo.getName() + "-view") && - !r.getMetadata().getName().equals("simple-role-binding"); + !r.getMetadata().getName().endsWith("-role-binding"); } if (r instanceof Service || r instanceof Deployment || r instanceof ServiceAccount) { return !r.getMetadata().getName().equals(appInfo.getName()); @@ -128,7 +127,7 @@ private List filterOutStandardResources(List list, App private void addResourceToHelmDir(File helmDir, List list) { String yaml = kubernetesSerialization.asYaml(list); try { - Files.writeString(Path.of(helmDir.getPath(), TEMPLATES_DIR, "deployment.yaml"), yaml); + Files.writeString(Path.of(helmDir.getPath(), TEMPLATES_DIR, "kubernetes.yml"), yaml); } catch (IOException e) { throw new IllegalStateException(e); }