name: UpgradeCRDs
description: 'Installs Go Downloads and installs Karpenter Dependencies'
inputs:
  account_id:
    description: "Account ID to access AWS"
    required: true
  role:
    description: "Role to access AWS"
    required: true
  region:
    description: "Region to access AWS"
    required: true
  cluster_name:
    description: 'Name of the cluster to be launched by eksctl'
    required: true
  git_ref:
    description: "The git commit, tag, or branch to check out. Requires a corresponding Karpenter snapshot release"
runs:
  using: "composite"
  steps:
    - name: configure aws credentials
      uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
      with:
        role-to-assume: arn:aws:iam::${{ inputs.account_id }}:role/${{ inputs.role }}
        aws-region: ${{ inputs.region }}
        role-duration-seconds: 21600
    - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
      with:
        ref: ${{ inputs.git_ref }}
    - name: install-karpenter
      shell: bash
      env:
        CLUSTER_NAME: ${{ inputs.cluster_name }}
      run: |
        aws eks update-kubeconfig --name "$CLUSTER_NAME"
        kubectl apply -f pkg/apis/crds/
