Skip to content

Commit

Permalink
chore: updating permissions of eks & ecr nightly tests (#2745)
Browse files Browse the repository at this point in the history
Signed-off-by: Austin Abro <AustinAbro321@gmail.com>
  • Loading branch information
AustinAbro321 committed Jul 22, 2024
1 parent 0d3d0c3 commit 05ef439
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/nightly-ecr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Test ECR Publishing
on:
schedule:
- cron: '0 7 * * * ' ## Every day at 0700 UTC

workflow_dispatch: ## Give us the ability to run this manually


Expand All @@ -28,11 +27,13 @@ jobs:
- name: Build the Zarf binary
run: make build-cli-linux-amd

- name: Configure AWS Credentials
- name: Auth with AWS
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1
with:
role-to-assume: ${{ secrets.AWS_NIGHTLY_ROLE }}
role-session-name: ${{ github.job || github.event.client_payload.pull_request.head.sha || github.sha }}
aws-region: us-east-1
role-duration-seconds: 3600

# NOTE: The aws cli will need to be explicitly installed on self-hosted runners
- name: Login to the ECR Registry
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/nightly-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Test EKS Cluster
on:
schedule:
- cron: '0 7 * * *' ## Every day at 0700 UTC

workflow_dispatch: ## Give us the ability to run this manually
inputs:
cluster_name:
Expand Down Expand Up @@ -36,12 +35,13 @@ jobs:
- name: Build binary and zarf packages
uses: ./.github/actions/packages

- name: Configure AWS Credentials
- name: Auth with AWS
uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1
with:
role-to-assume: ${{ secrets.AWS_NIGHTLY_ROLE }}
role-session-name: ${{ github.job || github.event.client_payload.pull_request.head.sha || github.sha }}
aws-region: us-east-1
role-duration-seconds: 14400
role-duration-seconds: 3600

- name: Build the eks package
run: ./build/zarf package create packages/distros/eks -o build --confirm
Expand All @@ -55,7 +55,7 @@ jobs:
--confirm
- name: Run tests
run: make test-e2e ARCH=amd64
run: make test-e2e-with-cluster ARCH=amd64

- name: Teardown the cluster
if: always()
Expand Down
17 changes: 17 additions & 0 deletions packages/distros/eks/eks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,36 @@ metadata:
name: ###ZARF_VAR_EKS_CLUSTER_NAME###
region: ###ZARF_VAR_EKS_CLUSTER_REGION###
version: "###ZARF_VAR_EKS_CLUSTER_VERSION###"
tags:
PermissionsBoundary: "zarf_dev_base_policy"

iam:
withOIDC: true
serviceRolePermissionsBoundary: "arn:aws:iam::173911864621:policy/zarf_dev_base_policy"

addons:
- name: aws-ebs-csi-driver
version: "###ZARF_VAR_EBS_DRIVER_VERSION###"
attachPolicyARNs:
- arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy
permissionsBoundary: "arn:aws:iam::173911864621:policy/zarf_dev_base_policy"
tags:
PermissionsBoundary: "zarf_dev_base_policy"

- name: vpc-cni
attachPolicyARNs:
- arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy
permissionsBoundary: "arn:aws:iam::173911864621:policy/zarf_dev_base_policy"
tags:
PermissionsBoundary: "zarf_dev_base_policy"

managedNodeGroups:
- instanceType: ###ZARF_VAR_EKS_INSTANCE_TYPE###
name: ###ZARF_VAR_EKS_CLUSTER_NAME###-ng
minSize: 3
maxSize: 6
spot: true
tags:
PermissionsBoundary: "zarf_dev_base_policy"
iam:
instanceRolePermissionsBoundary: "arn:aws:iam::173911864621:policy/zarf_dev_base_policy"
4 changes: 2 additions & 2 deletions src/test/nightly/ecr_publish_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func TestECRPublishing(t *testing.T) {
testPackageVersion := "0.0.1"
testPackageFileName := fmt.Sprintf("zarf-package-%s-%s-%s.tar.zst", testPackageName, e2e.Arch, testPackageVersion)
testPackageLocation := filepath.Join(tmpDir, testPackageFileName)
registryURL := "oci://public.ecr.aws/t8y5r5z5/zarf-nightly"
upstreamPackageURL := fmt.Sprintf("%s/%s:%s-%s", registryURL, testPackageName, testPackageVersion, e2e.Arch)
registryURL := "oci://public.ecr.aws/z6q5p6f7/zarf-nightly"
upstreamPackageURL := fmt.Sprintf("%s/%s:%s", registryURL, testPackageName, testPackageVersion)
keyFlag := fmt.Sprintf("--key=%s", "./src/test/packages/zarf-test.pub")

// Build the package with our test signature
Expand Down

0 comments on commit 05ef439

Please sign in to comment.