From 13fa94706259cf1303303013adc7f290a5ab5495 Mon Sep 17 00:00:00 2001 From: Sam Alba Date: Thu, 18 Mar 2021 15:54:53 -0700 Subject: [PATCH] stdlib: cue fmt Signed-off-by: Sam Alba --- examples/aws-eks/cue.mod/module.cue | 1 - examples/aws-eks/cue.mod/pkg/dagger.io | 1 - stdlib/aws/cloudformation/cloudformation.cue | 90 ++++++++++---------- stdlib/aws/eks/code.cue | 36 ++++---- 4 files changed, 62 insertions(+), 66 deletions(-) delete mode 100644 examples/aws-eks/cue.mod/module.cue delete mode 120000 examples/aws-eks/cue.mod/pkg/dagger.io diff --git a/examples/aws-eks/cue.mod/module.cue b/examples/aws-eks/cue.mod/module.cue deleted file mode 100644 index f8af9cef..00000000 --- a/examples/aws-eks/cue.mod/module.cue +++ /dev/null @@ -1 +0,0 @@ -module: "" diff --git a/examples/aws-eks/cue.mod/pkg/dagger.io b/examples/aws-eks/cue.mod/pkg/dagger.io deleted file mode 120000 index 1aafa4de..00000000 --- a/examples/aws-eks/cue.mod/pkg/dagger.io +++ /dev/null @@ -1 +0,0 @@ -../../../../stdlib \ No newline at end of file diff --git a/stdlib/aws/cloudformation/cloudformation.cue b/stdlib/aws/cloudformation/cloudformation.cue index 2b504895..43d3e52f 100644 --- a/stdlib/aws/cloudformation/cloudformation.cue +++ b/stdlib/aws/cloudformation/cloudformation.cue @@ -46,51 +46,49 @@ import ( outputs: [string]: string - outputs: { - #compute: [ - llb.#Load & { - from: aws.#CLI - }, - llb.#Mkdir & { - path: "/src" - }, - for dest, content in #files { - llb.#WriteFile & { - "dest": dest - "content": content + outputs: #compute: [ + llb.#Load & { + from: aws.#CLI + }, + llb.#Mkdir & { + path: "/src" + }, + for dest, content in #files { + llb.#WriteFile & { + "dest": dest + "content": content + } + }, + llb.#Exec & { + args: [ + "/bin/bash", + "--noprofile", + "--norc", + "-eo", + "pipefail", + "/entrypoint.sh", + ] + env: { + AWS_CONFIG_FILE: "/cache/aws/config" + AWS_ACCESS_KEY_ID: config.accessKey + AWS_SECRET_ACCESS_KEY: config.secretKey + AWS_DEFAULT_REGION: config.region + AWS_REGION: config.region + AWS_DEFAULT_OUTPUT: "json" + AWS_PAGER: "" + if neverUpdate { + NEVER_UPDATE: "true" } - }, - llb.#Exec & { - args: [ - "/bin/bash", - "--noprofile", - "--norc", - "-eo", - "pipefail", - "/entrypoint.sh", - ] - env: { - AWS_CONFIG_FILE: "/cache/aws/config" - AWS_ACCESS_KEY_ID: config.accessKey - AWS_SECRET_ACCESS_KEY: config.secretKey - AWS_DEFAULT_REGION: config.region - AWS_REGION: config.region - AWS_DEFAULT_OUTPUT: "json" - AWS_PAGER: "" - if neverUpdate { - NEVER_UPDATE: "true" - } - STACK_NAME: stackName - TIMEOUT: "\(timeout)" - ON_FAILURE: onFailure - } - dir: "/src" - mount: "/cache/aws": "cache" - }, - llb.#Export & { - source: "/outputs.json" - format: "json" - }, - ] - } + STACK_NAME: stackName + TIMEOUT: "\(timeout)" + ON_FAILURE: onFailure + } + dir: "/src" + mount: "/cache/aws": "cache" + }, + llb.#Export & { + source: "/outputs.json" + format: "json" + }, + ] } diff --git a/stdlib/aws/eks/code.cue b/stdlib/aws/eks/code.cue index 9a172275..9cb1a630 100644 --- a/stdlib/aws/eks/code.cue +++ b/stdlib/aws/eks/code.cue @@ -1,26 +1,26 @@ package eks #Code: #""" - [ -e /cache/bin/kubectl ] || { - curl -sfL https://dl.k8s.io/v1.19.9/bin/linux/amd64/kubectl -o /cache/bin/kubectl && chmod +x /cache/bin/kubectl - } + [ -e /cache/bin/kubectl ] || { + curl -sfL https://dl.k8s.io/v1.19.9/bin/linux/amd64/kubectl -o /cache/bin/kubectl && chmod +x /cache/bin/kubectl + } - export KUBECONFIG=/kubeconfig - export PATH="$PATH:/cache/bin" + export KUBECONFIG=/kubeconfig + export PATH="$PATH:/cache/bin" - # Generate a kube configuration - aws eks update-kubeconfig --name "$EKS_CLUSTER" + # Generate a kube configuration + aws eks update-kubeconfig --name "$EKS_CLUSTER" - # Figure out the kubernetes username - CONTEXT="$(kubectl config current-context)" - USER="$(kubectl config view -o json | \ - jq -r ".contexts[] | select(.name==\"$CONTEXT\") | .context.user")" + # Figure out the kubernetes username + CONTEXT="$(kubectl config current-context)" + USER="$(kubectl config view -o json | \ + jq -r ".contexts[] | select(.name==\"$CONTEXT\") | .context.user")" - # Grab a kubernetes access token - ACCESS_TOKEN="$(aws eks get-token --cluster-name "$EKS_CLUSTER" | \ - jq -r .status.token)" + # Grab a kubernetes access token + ACCESS_TOKEN="$(aws eks get-token --cluster-name "$EKS_CLUSTER" | \ + jq -r .status.token)" - # Remove the user config and replace it with the token - kubectl config unset "users.${USER}" - kubectl config set-credentials "$USER" --token "$ACCESS_TOKEN" - """# + # Remove the user config and replace it with the token + kubectl config unset "users.${USER}" + kubectl config set-credentials "$USER" --token "$ACCESS_TOKEN" + """#