-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor actions to move to common library #2253
Labels
openssf
Issues needing to be completed before donation to OpenSSF
tech-debt 💳
Debt that the team has charged and needs to repay
Comments
Tying this to this: #2203 since they are related |
We should ensure we add unit tests during this migration: #1750 |
requesting an easier pattern to set Currently now there's no way to set multiple For example: components:
- name: fetch-staged-aws-ssm-vars
required: false
description: "Fetch staged json object from AWS SSM Parameter Store and extract values for zarf variables"
actions:
onDeploy:
before:
# get the cluster name
- cmd: kubectl config current-context | awk -F'[:/]' '{print $NF}'
setVariables:
- name: CLUSTER_NAME
- cmd: aws eks describe-cluster --name ${ZARF_VAR_CLUSTER_NAME} --query 'cluster.endpoint' --output text | cut -d . -f3
setVariables:
- name: CLUSTER_AWS_REGION
- cmd: aws ssm get-parameter --name "/${ZARF_VAR_CLUSTER_NAME}/${ZARF_VAR_CLUSTER_AUTOSCALER_HELM_INPUT_VALUES_PATH}" --with-decryption
setVariables:
- name: CLUSTER_AUTOSCALER_HELM_INPUT_VALUES
- cmd: jq -r '.Parameter.Value | fromjson | .iam_role_arn' <<< "$ZARF_VAR_CLUSTER_AUTOSCALER_HELM_INPUT_VALUES"
setVariables:
- name: IAM_ROLE_ARN
- cmd: jq -r '.Parameter.Value | fromjson | .service_account' <<< "$ZARF_VAR_CLUSTER_AUTOSCALER_HELM_INPUT_VALUES"
setVariables:
- name: SERVICE_ACCOUNT could become - name: fetch-staged-aws-ssm-vars
required: false
description: "Fetch staged json object from AWS SSM Parameter Store and extract values for zarf variables"
actions:
onDeploy:
before:
- cmd: |
echo "CLUSTER_NAME=$(kubectl config current-context | awk -F'[:/]' '{print $NF}')" >> ZARF_ENV
echo "CLUSTER_AWS_REGION=$(aws eks describe-cluster --name ${ZARF_VAR_CLUSTER_NAME} --query 'cluster.endpoint' --output text | cut -d . -f3)" >> ZARF_ENV
echo "CLUSTER_AUTOSCALER_HELM_INPUT_VALUES=$(aws ssm get-parameter --name "/${ZARF_VAR_CLUSTER_NAME}/${ZARF_VAR_CLUSTER_AUTOSCALER_HELM_INPUT_VALUES_PATH}" --with-decryption)" >> ZARF_ENV
echo "IAM_ROLE_ARN=$(jq -r '.Parameter.Value | fromjson | .iam_role_arn' <<< "$ZARF_VAR_CLUSTER_AUTOSCALER_HELM_INPUT_VALUES")" >> ZARF_ENV
echo "SERVICE_ACCOUNT=$(jq -r '.Parameter.Value | fromjson | .service_account' <<< "$ZARF_VAR_CLUSTER_AUTOSCALER_HELM_INPUT_VALUES")" >> ZARF_ENV |
Noxsios
added
the
openssf
Issues needing to be completed before donation to OpenSSF
label
Mar 18, 2024
5 tasks
Noxsios
added a commit
that referenced
this issue
Apr 22, 2024
## Description Part of the actions refactor (split to reduce review time). This PR splits variables into it's own library that does not depend on Zarf specific code, fixes a bug with the new Helm Chart variables injection and overhauls the variables docs to be more readable and understandable and to include information on internal variables and the Helm Chart variables. ## Related Issue Relates to #2253 Fixes #2395 Fixes #1374 ## Type of change - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [X] Other (security config, docs update, etc) ## Checklist before merging - [X] Test, docs, adr added or updated as needed - [X] [Contributor Guide Steps](https://github.com/defenseunicorns/zarf/blob/main/CONTRIBUTING.md#developer-workflow) followed --------- Co-authored-by: Lucas Rodriguez <lucas.rodriguez9616@gmail.com> Co-authored-by: Austin Abro <37223396+AustinAbro321@users.noreply.github.com> Co-authored-by: razzle <razzle@defenseunicorns.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
openssf
Issues needing to be completed before donation to OpenSSF
tech-debt 💳
Debt that the team has charged and needs to repay
Describe what should be investigated or refactored
The actions functionality of zarf should be refactored and moved to https://github.com/defenseunicorns/pkg so it can by other projects.
The text was updated successfully, but these errors were encountered: