Skip to content

Commit

Permalink
workflows/test-upgrade.yaml: enhance local cluster checking
Browse files Browse the repository at this point in the history
Signed-off-by: Eguzki Astiz Lezaun <[email protected]>
  • Loading branch information
eguzki committed Feb 12, 2025
1 parent 3c28fd8 commit 943156a
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions .github/workflows/test-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,42 +134,39 @@ jobs:
olm-upgrade-test:
runs-on: ubuntu-latest
name: OLM Upgrade Test
if: ${{ github.event_name == 'workflow_dispatch' }}
env:
KIND_CLUSTER_NAME: kuadrant-test
K8S_USER: kuadrant-admin # can be whatever, it does not matter.
CLUSTER_NAME: remote-cluster
LOCAL_CLUSTER: ${{ inputs.clusterServer == '' && inputs.clusterToken == '' }}
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install helm
run: |
make helm
- name: Install yq tool
run: |
# following sub-shells running make target should have yq already installed
make yq
- name: Deploy local Kind cluster
if: ${{ github.event_name == 'workflow_dispatch' && inputs.clusterServer == '' }}
if: ${{ env.LOCAL_CLUSTER }}
uses: helm/[email protected]
with:
version: v0.23.0
config: utils/kind-cluster.yaml
cluster_name: ${{ env.KIND_CLUSTER_NAME }}
wait: 120s
- name: Install kubectl for remote cluster
if: ${{ github.event_name == 'workflow_dispatch' && inputs.clusterServer != '' }}
if: ${{ !env.LOCAL_CLUSTER }}
uses: azure/setup-kubectl@v4
with:
version: v1.31.0
- name: Mask cluster token
if: ${{ github.event_name == 'workflow_dispatch' && inputs.clusterToken != '' }}
if: ${{ !env.LOCAL_CLUSTER }}
run: |
CLUSTER_TOKEN=$(jq -r '.inputs.clusterToken' $GITHUB_EVENT_PATH)
echo ::add-mask::$CLUSTER_TOKEN
echo CLUSTER_TOKEN=$CLUSTER_TOKEN >> $GITHUB_ENV
- name: Setup kubectl for remote cluster
if: ${{ github.event_name == 'workflow_dispatch' && inputs.clusterServer != '' }}
if: ${{ !env.LOCAL_CLUSTER }}
run: |
kubectl config set-credentials ${{ env.K8S_USER }}/${{ env.CLUSTER_NAME }} --token ${{ env.CLUSTER_TOKEN }}
kubectl config set-cluster ${{ env.CLUSTER_NAME }} --insecure-skip-tls-verify=true --server=${{ inputs.clusterServer }}
Expand All @@ -180,11 +177,11 @@ jobs:
kubectl cluster-info
kubectl get nodes
- name: Deploy OLM on local Kind cluster
if: ${{ github.event_name == 'workflow_dispatch' && inputs.clusterServer == '' }}
if: ${{ env.LOCAL_CLUSTER }}
run: |
make install-olm
- name: Deploy pre-requisites on local Kind cluster
if: ${{ github.event_name == 'workflow_dispatch' && inputs.clusterServer == '' }}
if: ${{ env.LOCAL_CLUSTER }}
run: |
make install-metallb
make install-cert-manager
Expand Down

0 comments on commit 943156a

Please sign in to comment.