Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ ARG KUSTOMIZE=5.6.0
RUN curl -sL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2Fv${KUSTOMIZE}/kustomize_v${KUSTOMIZE}_linux_amd64.tar.gz | \
tar xz && mv kustomize /usr/local/bin/kustomize

ARG HELM_V3=3.17.1
RUN curl -sSL https://get.helm.sh/helm-v${HELM_V3}-linux-amd64.tar.gz | \
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

RUN rm -rf /var/cache/apk/*

COPY kustdiff /kustdiff
Expand Down
10 changes: 9 additions & 1 deletion kustdiff
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,15 @@ function build_ref {
local safe_path=$(safe_filename "$relative_path")
local output_file="$output_dir/${safe_path}.yaml"
echo "Running kustomize for $envpath"
kustomize build "$envpath" -o "$output_file"

# Check if kustomization.yaml contains helmCharts
local helm_flag=""
if grep -q "helmCharts:" "$envpath/kustomization.yaml"; then
debug_log "Helm charts detected in $envpath, enabling Helm support"
helm_flag="--enable-helm"
fi

kustomize build $helm_flag "$envpath" -o "$output_file"

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