Skip to content

Commit 804279c

Browse files
authored
Merge pull request #20 from swade1987/next
feat: add automatic Helm chart support detection
2 parents 8af0d46 + 92f071a commit 804279c

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ ARG KUSTOMIZE=5.6.0
88
RUN curl -sL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE}/kustomize_v${KUSTOMIZE}_linux_amd64.tar.gz | \
99
tar xz && mv kustomize /usr/local/bin/kustomize
1010

11+
ARG HELM_V3=3.17.1
12+
RUN curl -sSL https://get.helm.sh/helm-v${HELM_V3}-linux-amd64.tar.gz | \
13+
tar xz && mv linux-amd64/helm /usr/local/bin/helmv3 && rm -rf linux-amd64 && ln -s /usr/local/bin/helmv3 /usr/local/bin/helm && helm version
14+
1115
RUN rm -rf /var/cache/apk/*
1216

1317
COPY kustdiff /kustdiff

kustdiff

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,15 @@ function build_ref {
5050
local safe_path=$(safe_filename "$relative_path")
5151
local output_file="$output_dir/${safe_path}.yaml"
5252
echo "Running kustomize for $envpath"
53-
kustomize build "$envpath" -o "$output_file"
53+
54+
# Check if kustomization.yaml contains helmCharts
55+
local helm_flag=""
56+
if grep -q "helmCharts:" "$envpath/kustomization.yaml"; then
57+
debug_log "Helm charts detected in $envpath, enabling Helm support"
58+
helm_flag="--enable-helm"
59+
fi
60+
61+
kustomize build $helm_flag "$envpath" -o "$output_file"
5462

5563
if [ "$DEBUG" = "true" ]; then
5664
debug_log "Built kustomize for $envpath to $output_file"

0 commit comments

Comments
 (0)