fix linting errors

Signed-off-by: Sam Alba <sam.alba@gmail.com>
This commit is contained in:
Sam Alba 2021-03-24 09:36:19 -07:00
parent a3513ed479
commit ca613ea50b
3 changed files with 38 additions and 38 deletions

View File

@ -16,7 +16,7 @@ test:
.PHONY: cuefmt
cuefmt:
@(cue fmt -s ./stdlib/...)
@(cue fmt -s ./examples/*)
@(cue fmt -s ./examples/*/)
@(cue fmt -s ./tests/...)
.PHONY: lint

View File

@ -46,8 +46,8 @@ kubeApply: kubernetes.#Apply & {
// Fill using:
// --input-dir helmChart.chart=./testdata/mychart
helmChart: helm.#Chart & {
name: "test-helm"
namespace: "test"
name: "test-helm"
namespace: "test"
kubeconfig: cluster.kubeconfig
chart: dagger.#Artifact
chart: dagger.#Artifact
}

View File

@ -1,41 +1,41 @@
package helm
#code: #"""
# Add the repository
helm repo add repository "${HELM_REPO}"
helm repo update
# Add the repository
helm repo add repository "${HELM_REPO}"
helm repo update
# If the chart is a file, then it's the chart name
# If it's a directly, then it's the contents of the cart
if [ -f "/helm/chart" ]; then
HELM_CHART="repository/$(cat /helm/chart)"
else
HELM_CHART="/helm/chart"
fi
# If the chart is a file, then it's the chart name
# If it's a directly, then it's the contents of the cart
if [ -f "/helm/chart" ]; then
HELM_CHART="repository/$(cat /helm/chart)"
else
HELM_CHART="/helm/chart"
fi
OPTS=""
OPTS="$OPTS --timeout "$HELM_TIMEOUT""
OPTS="$OPTS --namespace "$KUBE_NAMESPACE""
[ "$HELM_WAIT" = "true" ] && OPTS="$OPTS --wait"
[ "$HELM_ATOMIC" = "true" ] && OPTS="$OPTS --atomic"
[ -f "/helm/values.yaml" ] && OPTS="$OPTS -f /helm/values.yaml"
OPTS=""
OPTS="$OPTS --timeout "$HELM_TIMEOUT""
OPTS="$OPTS --namespace "$KUBE_NAMESPACE""
[ "$HELM_WAIT" = "true" ] && OPTS="$OPTS --wait"
[ "$HELM_ATOMIC" = "true" ] && OPTS="$OPTS --atomic"
[ -f "/helm/values.yaml" ] && OPTS="$OPTS -f /helm/values.yaml"
# Select the namespace
kubectl create namespace "$KUBE_NAMESPACE" || true
# Select the namespace
kubectl create namespace "$KUBE_NAMESPACE" || true
case "$HELM_ACTION" in
install)
helm install $OPTS "$HELM_NAME" "$HELM_CHART"
;;
upgrade)
helm upgrade $OPTS "$HELM_NAME" "$HELM_CHART"
;;
installOrUpgrade)
helm upgrade $OPTS --install "$HELM_NAME" "$HELM_CHART"
;;
*)
echo unsupported helm action "$HELM_ACTION"
exit 1
;;
esac
"""#
case "$HELM_ACTION" in
install)
helm install $OPTS "$HELM_NAME" "$HELM_CHART"
;;
upgrade)
helm upgrade $OPTS "$HELM_NAME" "$HELM_CHART"
;;
installOrUpgrade)
helm upgrade $OPTS --install "$HELM_NAME" "$HELM_CHART"
;;
*)
echo unsupported helm action "$HELM_ACTION"
exit 1
;;
esac
"""#