Skip to content

Commit

Permalink
Migrate janitor to kubetest2 (#1700)
Browse files Browse the repository at this point in the history
  • Loading branch information
cartermckinnon authored Mar 1, 2024
1 parent b39ea0a commit 6f4be22
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 54 deletions.
13 changes: 0 additions & 13 deletions .github/actions/janitor/cluster-sweeper/action.yaml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/actions/janitor/cluster-sweeper/script.sh

This file was deleted.

16 changes: 16 additions & 0 deletions .github/actions/janitor/kubetest2-sweeper/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "[Janitor] kubetest2 sweeper"
description: "🗑️ Deletes kubetest2 resources when they're no longer needed"
inputs:
max_resource_age_duration:
description: "Golang duration after creation when resources become eligible for deletion"
required: true
runs:
using: "composite"
steps:
- shell: bash
run: |
export PATH=${PATH}:$(go env GOPATH)/bin
go install sigs.k8s.io/kubetest2/...@latest
go install github.com/aws/aws-k8s-tester/kubetest2/...@latest
kubetest2 eksapi-janitor -max-resource-age=${{ inputs.max_resource_age_duration }}
7 changes: 3 additions & 4 deletions .github/workflows/janitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:
id-token: write
contents: read
jobs:
cluster-sweeper:
kubetest2-sweeper:
# disable in forks
if: github.repository == 'awslabs/amazon-eks-ami'
runs-on: ubuntu-latest
Expand All @@ -18,10 +18,9 @@ jobs:
with:
aws-region: ${{ secrets.AWS_REGION }}
role-to-assume: ${{ secrets.AWS_ROLE_ARN_JANITOR }}
- uses: ./.github/actions/janitor/cluster-sweeper
- uses: ./.github/actions/janitor/kubetest2-sweeper
with:
# 3 hours
max_age_seconds: 10800
max_resource_age_duration: 3h
ami-sweeper:
# disable in forks
if: github.repository == 'awslabs/amazon-eks-ami'
Expand Down

0 comments on commit 6f4be22

Please sign in to comment.