From 55d0855c5a442308fe0168f4863835c8964ffea0 Mon Sep 17 00:00:00 2001 From: salvatoremazz Date: Fri, 3 Feb 2023 18:35:33 +0100 Subject: [PATCH 1/3] chore(kustomize): add enable-helm flag Signed-off-by: salvatoremazz --- .../manifests/kustomize/KustomizeBakeManifestRequest.java | 1 + .../rosco/manifests/kustomize/KustomizeTemplateUtils.java | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/rosco-manifests/src/main/java/com/netflix/spinnaker/rosco/manifests/kustomize/KustomizeBakeManifestRequest.java b/rosco-manifests/src/main/java/com/netflix/spinnaker/rosco/manifests/kustomize/KustomizeBakeManifestRequest.java index c22235419..52ac88e8b 100644 --- a/rosco-manifests/src/main/java/com/netflix/spinnaker/rosco/manifests/kustomize/KustomizeBakeManifestRequest.java +++ b/rosco-manifests/src/main/java/com/netflix/spinnaker/rosco/manifests/kustomize/KustomizeBakeManifestRequest.java @@ -26,4 +26,5 @@ public class KustomizeBakeManifestRequest extends BakeManifestRequest { private Artifact inputArtifact; private String kustomizeFilePath; + private boolean isEnableHelm; } diff --git a/rosco-manifests/src/main/java/com/netflix/spinnaker/rosco/manifests/kustomize/KustomizeTemplateUtils.java b/rosco-manifests/src/main/java/com/netflix/spinnaker/rosco/manifests/kustomize/KustomizeTemplateUtils.java index c27a4076f..14611d2ca 100644 --- a/rosco-manifests/src/main/java/com/netflix/spinnaker/rosco/manifests/kustomize/KustomizeTemplateUtils.java +++ b/rosco-manifests/src/main/java/com/netflix/spinnaker/rosco/manifests/kustomize/KustomizeTemplateUtils.java @@ -132,6 +132,11 @@ private BakeRecipe buildBakeRecipeFromGitRepo( List command = new ArrayList<>(); command.add(executable); command.add("build"); + + if (request.isEnableHelm()) { + command.add("--enable-helm"); + } + command.add(env.resolvePath(kustomizeFilePath).getParent().toString()); BakeRecipe result = new BakeRecipe(); From 9111bb805ede8c8c97c33435741c63f5289a82bc Mon Sep 17 00:00:00 2001 From: salvatoremazz Date: Fri, 3 Feb 2023 18:49:06 +0100 Subject: [PATCH 2/3] template renderer must be kustomize4 Signed-off-by: salvatoremazz --- .../rosco/manifests/kustomize/KustomizeTemplateUtils.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rosco-manifests/src/main/java/com/netflix/spinnaker/rosco/manifests/kustomize/KustomizeTemplateUtils.java b/rosco-manifests/src/main/java/com/netflix/spinnaker/rosco/manifests/kustomize/KustomizeTemplateUtils.java index 14611d2ca..df624bacc 100644 --- a/rosco-manifests/src/main/java/com/netflix/spinnaker/rosco/manifests/kustomize/KustomizeTemplateUtils.java +++ b/rosco-manifests/src/main/java/com/netflix/spinnaker/rosco/manifests/kustomize/KustomizeTemplateUtils.java @@ -23,6 +23,7 @@ import com.netflix.spinnaker.rosco.jobs.BakeRecipe; import com.netflix.spinnaker.rosco.manifests.ArtifactDownloader; import com.netflix.spinnaker.rosco.manifests.BakeManifestEnvironment; +import com.netflix.spinnaker.rosco.manifests.BakeManifestRequest; import com.netflix.spinnaker.rosco.manifests.config.RoscoKustomizeConfigurationProperties; import com.netflix.spinnaker.rosco.manifests.kustomize.mapping.Kustomization; import java.io.File; @@ -133,7 +134,8 @@ private BakeRecipe buildBakeRecipeFromGitRepo( command.add(executable); command.add("build"); - if (request.isEnableHelm()) { + if (request.isEnableHelm() + && request.getTemplateRenderer() == BakeManifestRequest.TemplateRenderer.KUSTOMIZE4) { command.add("--enable-helm"); } From 82ef301b1c22769c39dff6ec987902fb8d96a31d Mon Sep 17 00:00:00 2001 From: Salvatore Mazzarino Date: Mon, 6 Feb 2023 09:27:49 +0100 Subject: [PATCH 3/3] Update rosco-manifests/src/main/java/com/netflix/spinnaker/rosco/manifests/kustomize/KustomizeBakeManifestRequest.java Co-authored-by: David Byron <82477955+dbyron-sf@users.noreply.github.com> --- .../rosco/manifests/kustomize/KustomizeBakeManifestRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rosco-manifests/src/main/java/com/netflix/spinnaker/rosco/manifests/kustomize/KustomizeBakeManifestRequest.java b/rosco-manifests/src/main/java/com/netflix/spinnaker/rosco/manifests/kustomize/KustomizeBakeManifestRequest.java index 52ac88e8b..87e29775d 100644 --- a/rosco-manifests/src/main/java/com/netflix/spinnaker/rosco/manifests/kustomize/KustomizeBakeManifestRequest.java +++ b/rosco-manifests/src/main/java/com/netflix/spinnaker/rosco/manifests/kustomize/KustomizeBakeManifestRequest.java @@ -26,5 +26,5 @@ public class KustomizeBakeManifestRequest extends BakeManifestRequest { private Artifact inputArtifact; private String kustomizeFilePath; - private boolean isEnableHelm; + private boolean enableHelm; }