From 484913ab81770979b8de3bf37709d354d5d35ab3 Mon Sep 17 00:00:00 2001 From: Anand Kumar Singh Date: Tue, 23 Jun 2026 16:27:54 +0530 Subject: [PATCH 1/6] Initital CI automation for GitOps operator support for xKS test assisted-by: ClaudeCode Signed-off-by: Anand Kumar Singh --- .github/workflows/deploy-test.yaml | 57 ++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/deploy-test.yaml diff --git a/.github/workflows/deploy-test.yaml b/.github/workflows/deploy-test.yaml new file mode 100644 index 00000000000..5b0bbdcae36 --- /dev/null +++ b/.github/workflows/deploy-test.yaml @@ -0,0 +1,57 @@ +name: Build, Push, Deploy and Test on kind + +on: + pull_request: + branches: + - '*' + +env: + IMG: quay.io/redhat-developer/gitops-operator:pr-${{ github.event.pull_request.number }}-${{ github.run_id }} + +jobs: + deploy-test: + name: Build image, deploy to kind cluster and run tests + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: 'go.mod' + + - name: Log in to Quay.io + uses: docker/login-action@v3 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Build manager image with TTL label + run: | + docker build -t ${{ env.IMG }} --label quay.expires-after=1d . + + - name: Push image to Quay.io + run: | + docker push ${{ env.IMG }} + + - name: Create kind cluster + uses: helm/kind-action@v1 + with: + cluster_name: gitops-test + + - name: Install CRDs + run: | + make install + + - name: Deploy operator + run: | + make deploy IMG=${{ env.IMG }} + + - name: Verify Controller Manager deployment is available + run: | + kubectl wait --for=condition=available --timeout=120s \ + deployment/openshift-gitops-operator-controller-manager \ + -n openshift-gitops-operator + kubectl get pods -n openshift-gitops-operator From e6fdc76852bc7c07aa9cd8aa5f15873229d3df9c Mon Sep 17 00:00:00 2001 From: Anand Kumar Singh Date: Tue, 23 Jun 2026 21:18:20 +0530 Subject: [PATCH 2/6] use kind internal registry to deploy assisted-by: ClaudeCode Signed-off-by: Anand Kumar Singh --- .github/workflows/deploy-test.yaml | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/.github/workflows/deploy-test.yaml b/.github/workflows/deploy-test.yaml index 5b0bbdcae36..39d2866d491 100644 --- a/.github/workflows/deploy-test.yaml +++ b/.github/workflows/deploy-test.yaml @@ -1,4 +1,4 @@ -name: Build, Push, Deploy and Test on kind +name: Build, Deploy and Test on kind on: pull_request: @@ -6,7 +6,7 @@ on: - '*' env: - IMG: quay.io/redhat-developer/gitops-operator:pr-${{ github.event.pull_request.number }}-${{ github.run_id }} + IMG: gitops-operator:test jobs: deploy-test: @@ -21,25 +21,18 @@ jobs: with: go-version-file: 'go.mod' - - name: Log in to Quay.io - uses: docker/login-action@v3 + - name: Create kind cluster + uses: helm/kind-action@v1 with: - registry: quay.io - username: ${{ secrets.QUAY_USERNAME }} - password: ${{ secrets.QUAY_PASSWORD }} + cluster_name: gitops-test - - name: Build manager image with TTL label + - name: Build manager image run: | - docker build -t ${{ env.IMG }} --label quay.expires-after=1d . + docker build -t ${{ env.IMG }} . - - name: Push image to Quay.io + - name: Load image into kind run: | - docker push ${{ env.IMG }} - - - name: Create kind cluster - uses: helm/kind-action@v1 - with: - cluster_name: gitops-test + kind load docker-image ${{ env.IMG }} --name gitops-test - name: Install CRDs run: | From caccc0a5f4ae79d8fc1211da80b8e59eb896b2bf Mon Sep 17 00:00:00 2001 From: Anand Kumar Singh Date: Thu, 25 Jun 2026 11:55:46 +0530 Subject: [PATCH 3/6] remove prometheus from make deploy kustomize Signed-off-by: Anand Kumar Singh --- .github/workflows/deploy-test.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-test.yaml b/.github/workflows/deploy-test.yaml index 39d2866d491..d8d46b4267b 100644 --- a/.github/workflows/deploy-test.yaml +++ b/.github/workflows/deploy-test.yaml @@ -28,7 +28,9 @@ jobs: - name: Build manager image run: | - docker build -t ${{ env.IMG }} . + # comment out prometheus from config/default/kustomization.yaml + sed -i 's|^- ../prometheus|#- ../prometheus|' config/default/kustomization.yaml + make build IMG=${{ env.IMG }} - name: Load image into kind run: | From 15599db5bd9a2e4d61d76e03ab73fac1be66ec1d Mon Sep 17 00:00:00 2001 From: Anand Kumar Singh Date: Thu, 25 Jun 2026 12:06:56 +0530 Subject: [PATCH 4/6] minor fix Signed-off-by: Anand Kumar Singh --- .github/workflows/deploy-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-test.yaml b/.github/workflows/deploy-test.yaml index d8d46b4267b..6fc54d3ec09 100644 --- a/.github/workflows/deploy-test.yaml +++ b/.github/workflows/deploy-test.yaml @@ -30,7 +30,7 @@ jobs: run: | # comment out prometheus from config/default/kustomization.yaml sed -i 's|^- ../prometheus|#- ../prometheus|' config/default/kustomization.yaml - make build IMG=${{ env.IMG }} + make docker-build IMG=${{ env.IMG }} - name: Load image into kind run: | From 0d8f0729fc67d9d0e2f4cc7fe9aecde518654793 Mon Sep 17 00:00:00 2001 From: Anand Kumar Singh Date: Thu, 25 Jun 2026 12:27:51 +0530 Subject: [PATCH 5/6] debug commit Signed-off-by: Anand Kumar Singh --- .github/workflows/deploy-test.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-test.yaml b/.github/workflows/deploy-test.yaml index 6fc54d3ec09..5f105dea8c0 100644 --- a/.github/workflows/deploy-test.yaml +++ b/.github/workflows/deploy-test.yaml @@ -46,7 +46,8 @@ jobs: - name: Verify Controller Manager deployment is available run: | + kubectl get deployment -n openshift-gitops-operator + kubectl describe deployment -n openshift-gitops-operator kubectl wait --for=condition=available --timeout=120s \ deployment/openshift-gitops-operator-controller-manager \ -n openshift-gitops-operator - kubectl get pods -n openshift-gitops-operator From 5413f4d36990dc38331c4f50a9a20fa674b6b206 Mon Sep 17 00:00:00 2001 From: Anand Kumar Singh Date: Mon, 29 Jun 2026 14:58:13 +0530 Subject: [PATCH 6/6] make webhook option with make deploy Signed-off-by: Anand Kumar Singh --- .github/workflows/deploy-test.yaml | 14 +++++++++----- config/default/manager_webhook_patch.yaml | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-test.yaml b/.github/workflows/deploy-test.yaml index 5f105dea8c0..285931ad22c 100644 --- a/.github/workflows/deploy-test.yaml +++ b/.github/workflows/deploy-test.yaml @@ -14,22 +14,26 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - name: Setup Go - uses: actions/setup-go@v5 + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 with: go-version-file: 'go.mod' - name: Create kind cluster - uses: helm/kind-action@v1 + uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1 with: cluster_name: gitops-test - - name: Build manager image + - name: Disable webhook and prometheus for non-OCP cluster run: | - # comment out prometheus from config/default/kustomization.yaml + sed -i 's|^- ../webhook|#- ../webhook|' config/default/kustomization.yaml + sed -i 's|^- manager_webhook_patch.yaml|#- manager_webhook_patch.yaml|' config/default/kustomization.yaml sed -i 's|^- ../prometheus|#- ../prometheus|' config/default/kustomization.yaml + + - name: Build manager image + run: | make docker-build IMG=${{ env.IMG }} - name: Load image into kind diff --git a/config/default/manager_webhook_patch.yaml b/config/default/manager_webhook_patch.yaml index 738de350b71..8b4e4aa8d77 100644 --- a/config/default/manager_webhook_patch.yaml +++ b/config/default/manager_webhook_patch.yaml @@ -21,3 +21,4 @@ spec: secret: defaultMode: 420 secretName: webhook-server-cert + optional: true