-
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,50 @@ | ||||||||||||||||||
| 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@v4 | ||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win Pin GitHub Actions to immutable commit SHAs Lines 17, 20, 25, and 40 use floating tags ( Suggested fix pattern- - name: Checkout code
- uses: actions/checkout@v4
+ - name: Checkout code
+ uses: actions/checkout@<full-commit-sha>
- - name: Setup Go
- uses: actions/setup-go@v5
+ - name: Setup Go
+ uses: actions/setup-go@<full-commit-sha>
- - name: Log in to Quay.io
- uses: docker/login-action@v3
+ - name: Log in to Quay.io
+ uses: docker/login-action@<full-commit-sha>
- - name: Create kind cluster
- uses: helm/kind-action@v1
+ - name: Create kind cluster
+ uses: helm/kind-action@<full-commit-sha>Also applies to: 20-20, 25-25, 40-40 🧰 Tools🪛 zizmor (1.26.1)[warning] 16-17: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 17-17: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||||||||||||||||||
|
|
||||||||||||||||||
| - name: Setup Go | ||||||||||||||||||
| uses: actions/setup-go@v5 | ||||||||||||||||||
| with: | ||||||||||||||||||
| go-version-file: 'go.mod' | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Create kind cluster | ||||||||||||||||||
| uses: helm/kind-action@v1 | ||||||||||||||||||
| with: | ||||||||||||||||||
| cluster_name: gitops-test | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Build manager image | ||||||||||||||||||
| run: | | ||||||||||||||||||
| docker build -t ${{ 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 wait --for=condition=available --timeout=120s \ | ||||||||||||||||||
| deployment/openshift-gitops-operator-controller-manager \ | ||||||||||||||||||
| -n openshift-gitops-operator | ||||||||||||||||||
| kubectl get pods -n openshift-gitops-operator | ||||||||||||||||||
|
Comment on lines
+47
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Controller verification targets the wrong Deployment/namespace Line 54–57 waits for Suggested fix - 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
+ deployment/argocd-operator-controller-manager \
+ -n argocd-operator-system
+ kubectl get pods -n argocd-operator-system📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Linked repositories |
||||||||||||||||||
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.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Disable credential persistence in checkout step
Line 17 uses
actions/checkoutwith default credential persistence. That leaves the GitHub token in local git config for subsequent steps, which is unnecessary for this workflow and expands credential exposure risk.Suggested fix
- name: Checkout code uses: actions/checkout@v4 + with: + persist-credentials: false📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.26.1)
[warning] 16-17: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[error] 17-17: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🤖 Prompt for AI Agents
Source: Linters/SAST tools