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
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ if [[ -z "${DRY_RUN_FLAG:-}" && -f "${SCRIPT_DIR}/.aicr-chart.tgz" ]]; then
REPO=""
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} kai-scheduler "${CHART_REF}" \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} 'kai-scheduler' "${CHART_REF}" \
${REPO:+--repo "${REPO}"} "${CHART_VERSION_ARGS[@]}" \
--namespace kai-scheduler --create-namespace \
--namespace 'kai-scheduler' --create-namespace \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [[ "${HELM_MAJOR:-0}" -ge 4 ]]; then
FORCE_CONFLICTS_FLAG="--force-conflicts"
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} skyhook-customizations ./ \
--namespace skyhook --create-namespace \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} 'skyhook-customizations' ./ \
--namespace 'skyhook' --create-namespace \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [[ "${HELM_MAJOR:-0}" -ge 4 ]]; then
FORCE_CONFLICTS_FLAG="--force-conflicts"
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} gpu-operator-pre ./ \
--namespace privileged-gpu-operator \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} 'gpu-operator-pre' ./ \
--namespace 'privileged-gpu-operator' \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ if [[ -z "${DRY_RUN_FLAG:-}" && -f "${SCRIPT_DIR}/.aicr-chart.tgz" ]]; then
REPO=""
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} gpu-operator "${CHART_REF}" \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} 'gpu-operator' "${CHART_REF}" \
${REPO:+--repo "${REPO}"} "${CHART_VERSION_ARGS[@]}" \
--namespace privileged-gpu-operator --create-namespace \
--namespace 'privileged-gpu-operator' --create-namespace \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [[ "${HELM_MAJOR:-0}" -ge 4 ]]; then
FORCE_CONFLICTS_FLAG="--force-conflicts"
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} gpu-operator-post ./ \
--namespace privileged-gpu-operator --create-namespace \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} 'gpu-operator-post' ./ \
--namespace 'privileged-gpu-operator' --create-namespace \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [[ "${HELM_MAJOR:-0}" -ge 4 ]]; then
FORCE_CONFLICTS_FLAG="--force-conflicts"
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} foo-pre ./ \
--namespace privileged-foo \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} 'foo-pre' ./ \
--namespace 'privileged-foo' \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ if [[ -z "${DRY_RUN_FLAG:-}" && -f "${SCRIPT_DIR}/.aicr-chart.tgz" ]]; then
REPO=""
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} foo "${CHART_REF}" \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} 'foo' "${CHART_REF}" \
${REPO:+--repo "${REPO}"} "${CHART_VERSION_ARGS[@]}" \
--namespace privileged-foo --create-namespace \
--namespace 'privileged-foo' --create-namespace \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ if [[ -z "${DRY_RUN_FLAG:-}" && -f "${SCRIPT_DIR}/.aicr-chart.tgz" ]]; then
REPO=""
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} nodewright-operator "${CHART_REF}" \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} 'nodewright-operator' "${CHART_REF}" \
${REPO:+--repo "${REPO}"} "${CHART_VERSION_ARGS[@]}" \
--namespace skyhook --create-namespace \
--namespace 'skyhook' --create-namespace \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ if [[ -z "${DRY_RUN_FLAG:-}" && -f "${SCRIPT_DIR}/.aicr-chart.tgz" ]]; then
REPO=""
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} k8s-aibom "${CHART_REF}" \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} 'k8s-aibom' "${CHART_REF}" \
${REPO:+--repo "${REPO}"} "${CHART_VERSION_ARGS[@]}" \
--namespace k8s-aibom-system --create-namespace \
--namespace 'k8s-aibom-system' --create-namespace \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ if [[ -z "${DRY_RUN_FLAG:-}" && -f "${SCRIPT_DIR}/.aicr-chart.tgz" ]]; then
REPO=""
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} k8s-aibom "${CHART_REF}" \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} 'k8s-aibom' "${CHART_REF}" \
${REPO:+--repo "${REPO}"} "${CHART_VERSION_ARGS[@]}" \
--namespace k8s-aibom-system --create-namespace \
--namespace 'k8s-aibom-system' --create-namespace \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ if [[ -z "${DRY_RUN_FLAG:-}" && -f "${SCRIPT_DIR}/.aicr-chart.tgz" ]]; then
REPO=""
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} foo "${CHART_REF}" \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} 'foo' "${CHART_REF}" \
${REPO:+--repo "${REPO}"} "${CHART_VERSION_ARGS[@]}" \
--namespace foo --create-namespace \
--namespace 'foo' --create-namespace \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [[ "${HELM_MAJOR:-0}" -ge 4 ]]; then
FORCE_CONFLICTS_FLAG="--force-conflicts"
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} foo-readiness ./ \
--namespace foo --create-namespace \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} 'foo-readiness' ./ \
--namespace 'foo' --create-namespace \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ if [[ -z "${DRY_RUN_FLAG:-}" && -f "${SCRIPT_DIR}/.aicr-chart.tgz" ]]; then
REPO=""
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} cert-manager "${CHART_REF}" \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} 'cert-manager' "${CHART_REF}" \
${REPO:+--repo "${REPO}"} "${CHART_VERSION_ARGS[@]}" \
--namespace cert-manager --create-namespace \
--namespace 'cert-manager' --create-namespace \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
4 changes: 3 additions & 1 deletion pkg/bundler/deployer/localformat/local_helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ var localHelmTemplates embed.FS

var (
localHelmInstallTmpl = template.Must(
template.ParseFS(localHelmTemplates, "templates/install-local-helm.sh.tmpl"),
template.New("install-local-helm.sh.tmpl").
Funcs(shellFuncs).
ParseFS(localHelmTemplates, "templates/install-local-helm.sh.tmpl"),
)
localHelmChartTmpl = template.Must(
template.New("chart.yaml.tmpl").
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if [[ -z "${DRY_RUN_FLAG:-}" ]]; then
bash ./apply-crds.sh
fi

{{ end }}helm upgrade --install ${FORCE_CONFLICTS_FLAG} {{ .Name }} ./ \
--namespace {{ .Namespace }}{{ if .CreateNamespace }} --create-namespace{{ end }} \
{{ end }}helm upgrade --install ${FORCE_CONFLICTS_FLAG} {{ .Name | shq }} ./ \
--namespace {{ .Namespace | shq }}{{ if .CreateNamespace }} --create-namespace{{ end }} \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ if [[ -z "${DRY_RUN_FLAG:-}" && -f "${SCRIPT_DIR}/.aicr-chart.tgz" ]]; then
REPO=""
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} {{ .Name }} "${CHART_REF}" \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} {{ .Name | shq }} "${CHART_REF}" \
${REPO:+--repo "${REPO}"} "${CHART_VERSION_ARGS[@]}" \
--namespace {{ .Namespace }} --create-namespace \
--namespace {{ .Namespace | shq }} --create-namespace \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ if [[ -z "${DRY_RUN_FLAG:-}" && -f "${SCRIPT_DIR}/.aicr-chart.tgz" ]]; then
REPO=""
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} k8s-aibom "${CHART_REF}" \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} 'k8s-aibom' "${CHART_REF}" \
${REPO:+--repo "${REPO}"} "${CHART_VERSION_ARGS[@]}" \
--namespace k8s-aibom-system --create-namespace \
--namespace 'k8s-aibom-system' --create-namespace \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ if [[ -z "${DRY_RUN_FLAG:-}" && -f "${SCRIPT_DIR}/.aicr-chart.tgz" ]]; then
REPO=""
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} k8s-aibom "${CHART_REF}" \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} 'k8s-aibom' "${CHART_REF}" \
${REPO:+--repo "${REPO}"} "${CHART_VERSION_ARGS[@]}" \
--namespace k8s-aibom-system --create-namespace \
--namespace 'k8s-aibom-system' --create-namespace \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if [[ -z "${DRY_RUN_FLAG:-}" ]]; then
bash ./apply-crds.sh
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} k8s-aibom ./ \
--namespace k8s-aibom-system --create-namespace \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} 'k8s-aibom' ./ \
--namespace 'k8s-aibom-system' --create-namespace \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if [[ "${HELM_MAJOR:-0}" -ge 4 ]]; then
FORCE_CONFLICTS_FLAG="--force-conflicts"
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} skyhook-customizations ./ \
--namespace skyhook --create-namespace \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} 'skyhook-customizations' ./ \
--namespace 'skyhook' --create-namespace \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ if [[ -z "${DRY_RUN_FLAG:-}" && -f "${SCRIPT_DIR}/.aicr-chart.tgz" ]]; then
REPO=""
fi

helm upgrade --install ${FORCE_CONFLICTS_FLAG} nfd "${CHART_REF}" \
helm upgrade --install ${FORCE_CONFLICTS_FLAG} 'nfd' "${CHART_REF}" \
${REPO:+--repo "${REPO}"} "${CHART_VERSION_ARGS[@]}" \
--namespace node-feature-discovery --create-namespace \
--namespace 'node-feature-discovery' --create-namespace \
-f values.yaml -f cluster-values.yaml \
${COMPONENT_WAIT_ARGS:-} ${DRY_RUN_FLAG:-} ${KUBECONFIG_FLAG:-} ${HELM_DEBUG_FLAG:-}
19 changes: 12 additions & 7 deletions pkg/bundler/deployer/localformat/upstream_helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,23 @@ func shellSingleQuote(s string) string {
return "'" + strings.ReplaceAll(s, "'", `'\''`) + "'"
}

// shellFuncs is registered on every template that renders a shell script, so
// recipe-supplied values reach the generated shell as single-quoted literals.
// Component names are validated only as path components
// (IsSafePathComponent rejects separators, not shell metacharacters), and
// namespaces are not validated here at all, so neither is safe to interpolate
// bare into a command.
var shellFuncs = template.FuncMap{"shq": shellSingleQuote}

var upstreamHelmTmpl = template.Must(
template.ParseFS(upstreamHelmTemplates, "templates/install-upstream-helm.sh.tmpl"),
template.New("install-upstream-helm.sh.tmpl").
Funcs(shellFuncs).
ParseFS(upstreamHelmTemplates, "templates/install-upstream-helm.sh.tmpl"),
)

// applyCRDsTmpl registers shq so recipe-supplied names reach the generated
// shell as single-quoted literals. Component names are validated only as path
// components (IsSafePathComponent rejects separators, not shell
// metacharacters), and namespaces are not validated here at all, so neither is
// safe to interpolate bare into a command.
var applyCRDsTmpl = template.Must(
template.New("apply-crds.sh.tmpl").
Funcs(template.FuncMap{"shq": shellSingleQuote}).
Funcs(shellFuncs).
ParseFS(applyCRDsTemplates, "templates/apply-crds.sh.tmpl"),
)

Expand Down
Loading
Loading