Skip to content
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

Simplify actions; Resolve gosec issues #203

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions .github/workflows/go-postsubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,6 @@ on:
branches:
- main
- release-*
workflow_dispatch: {}

env:
# Common versions
GO_REQUIRED_MIN_VERSION: ''
GOPATH: '/home/runner/work/config-policy-controller/config-policy-controller/go'
defaults:
run:
working-directory: go/src/open-cluster-management.io/config-policy-controller

jobs:
verify:
Expand All @@ -22,13 +13,10 @@ jobs:
steps:
- name: checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
path: go/src/open-cluster-management.io/config-policy-controller
- name: install Go
uses: actions/setup-go@v5
with:
go-version-file: go/src/open-cluster-management.io/config-policy-controller/go.mod
go-version-file: go.mod
- name: images
run: make build-images
- name: push
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/go-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ on:

env:
TAG: ${{ github.ref_name }}
defaults:
run:
working-directory: go/src/open-cluster-management.io/config-policy-controller


jobs:
release:
Expand All @@ -18,13 +16,10 @@ jobs:
steps:
- name: checkout code
uses: actions/checkout@v4
with:
fetch-depth: 1
path: go/src/open-cluster-management.io/config-policy-controller
- name: install Go
uses: actions/setup-go@v5
with:
go-version-file: go/src/open-cluster-management.io/config-policy-controller/go.mod
go-version-file: go.mod
- name: build images
run: |
make build-images
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/kind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:
defaults:
run:
shell: bash
working-directory: config-policy-controller

jobs:
kind-tests:
Expand All @@ -33,15 +32,11 @@ jobs:
steps:
- name: Checkout Config Policy Controller
uses: actions/checkout@v4
with:
path: config-policy-controller
fetch-depth: 0 # Fetch all history for all tags and branches

- name: Set up Go
uses: actions/setup-go@v5
id: go
with:
go-version-file: config-policy-controller/go.mod
go-version-file: go.mod

- name: Verify modules
run: |
Expand Down Expand Up @@ -75,7 +70,6 @@ jobs:

- name: E2E Tests
run: |
kubectl get pod -A
export GOPATH=$(go env GOPATH)
KUBECONFIG=${PWD}/kubeconfig_managed make e2e-test-coverage

Expand Down Expand Up @@ -105,6 +99,7 @@ jobs:
run: |
make test-coverage
make coverage-verify
make gosec-scan

- name: Debug
if: ${{ failure() }}
Expand Down
1 change: 1 addition & 0 deletions controllers/operatorpolicy_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ func opGroupTooManyObjs(opGroups []unstructured.Unstructured) []policyv1.Related
objs := make([]policyv1.RelatedObject, len(opGroups))

for i, opGroup := range opGroups {
opGroup := opGroup
objs[i] = policyv1.RelatedObject{
Object: policyv1.ObjectResourceFromObj(&opGroup),
Compliant: string(policyv1.NonCompliant),
Expand Down