-
Notifications
You must be signed in to change notification settings - Fork 354
Initial CI automation on test for GitOps operator support for xKS #1188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
anandrkskd
wants to merge
6
commits into
redhat-developer:master
Choose a base branch
from
anandrkskd:ci-test-xks
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+58
−0
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
484913a
Initital CI automation for GitOps operator support for xKS test
anandrkskd e6fdc76
use kind internal registry to deploy
anandrkskd caccc0a
remove prometheus from make deploy kustomize
anandrkskd 15599db
minor fix
anandrkskd 0d8f072
debug commit
anandrkskd 5413f4d
make webhook option with make deploy
anandrkskd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| name: Build, Deploy and Test on kind | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - '*' | ||
|
|
||
| env: | ||
| IMG: gitops-operator:test | ||
|
|
||
| jobs: | ||
| deploy-test: | ||
| name: Build image, deploy to kind cluster and run tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | ||
|
|
||
| - name: Setup Go | ||
| uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 | ||
| with: | ||
| go-version-file: 'go.mod' | ||
|
|
||
| - name: Create kind cluster | ||
| uses: helm/kind-action@ef37e7f390d99f746eb8b610417061a60e82a6cc # v1 | ||
| with: | ||
| cluster_name: gitops-test | ||
|
|
||
| - name: Disable webhook and prometheus for non-OCP cluster | ||
| run: | | ||
| 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 | ||
| run: | | ||
| kind load docker-image ${{ env.IMG }} --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 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,3 +21,4 @@ spec: | |
| secret: | ||
| defaultMode: 420 | ||
| secretName: webhook-server-cert | ||
| optional: true | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: redhat-developer/gitops-operator
Length of output: 264
🏁 Script executed:
Repository: redhat-developer/gitops-operator
Length of output: 6356
Cover the webhook patch change in deploy-test
config/default/manager_webhook_patch.yaml:21-24is only exercised whenmanager_webhook_patch.yamlstays enabled, but.github/workflows/deploy-test.yamlcomments that patch out beforemake deploy. Either move this change behind the same kind-only path or add a workflow job that deploys with webhooks enabled so this manifest change doesn't drift untested.🧰 Tools
🪛 Checkov (3.3.1)
[medium] 1-24: Containers should not run with allowPrivilegeEscalation
(CKV_K8S_20)
[medium] 1-24: Minimize the admission of root containers
(CKV_K8S_23)
🤖 Prompt for AI Agents