From ca613ea50bcd1e74c4f7d6e88e4213b583b69026 Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Wed, 24 Mar 2021 09:36:19 -0700 Subject: [PATCH] fix linting errors Signed-off-by: Sam Alba --- Makefile | 2 +- examples/kubernetes/main.cue | 6 +-- stdlib/kubernetes/helm/code.cue | 68 ++++++++++++++++----------------- 3 files changed, 38 insertions(+), 38 deletions(-) diff --git a/Makefile b/Makefile index c9ed0754..50814200 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/examples/kubernetes/main.cue b/examples/kubernetes/main.cue index 98cb8626..d35eb51d 100644 --- a/examples/kubernetes/main.cue +++ b/examples/kubernetes/main.cue @@ -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 } diff --git a/stdlib/kubernetes/helm/code.cue b/stdlib/kubernetes/helm/code.cue index 98da3765..cb871e1f 100644 --- a/stdlib/kubernetes/helm/code.cue +++ b/stdlib/kubernetes/helm/code.cue @@ -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 + """#