Skip to content

Upgrade gatekeeper function to Go 1.26.3 with latest dependencies#1252

Open
aravindtga wants to merge 1 commit into
kptdev:mainfrom
Nordix:upgrade-gatekeeper-go1.26.3-deps
Open

Upgrade gatekeeper function to Go 1.26.3 with latest dependencies#1252
aravindtga wants to merge 1 commit into
kptdev:mainfrom
Nordix:upgrade-gatekeeper-go1.26.3-deps

Conversation

@aravindtga
Copy link
Copy Markdown
Contributor

Upgrade the gatekeeper KRM function to Go 1.26.3 and update all dependencies to their latest compatible versions, aligning with the rest of the catalog.

Changes

Dependency upgrades

Dependency Before After
Go 1.25.7 1.26.3
kyaml v0.10.21 v0.21.1
gatekeeper v0.0.0-20220208 (unversioned) v3.22.2
k8s.io/apimachinery v0.21.9 v0.36.1
sigs.k8s.io/controller-runtime v0.9.7 v0.23.3 (indirect)
github.com/spf13/cobra v1.2.1 v1.10.2
sigs.k8s.io/yaml v1.3.0 v1.6.0

Testing

  • go build ./...
  • go test ./...
  • go vet ./...
  • E2E tests (all gatekeeper tests pass)

AI usage disclosure

  • AI assistance (Kiro CLI) was used to draft portions of this change, and this PR description.

Signed-off-by: Aravindhan Ayyanathan <aravindhan.a@est.tech>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 25, 2026

Deploy Preview for krm-function-catalog canceled.

Name Link
🔨 Latest commit 7abe894
🔍 Latest deploy log https://app.netlify.com/projects/krm-function-catalog/deploys/6a1432c0e77af50008140ec2

@aravindtga aravindtga marked this pull request as ready for review May 25, 2026 11:43
Copilot AI review requested due to automatic review settings May 25, 2026 11:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Upgrades the Gatekeeper Go KRM function to Go 1.26.3 and refreshes key dependencies (Gatekeeper v3, kyaml, Kubernetes libs), including updating the function result model and golden test/expected outputs to match the newer kyaml/framework behavior.

Changes:

  • Bump functions/go/gatekeeper to Go 1.26.3 and update dependencies (notably github.com/open-policy-agent/gatekeeper/v3 and sigs.k8s.io/kustomize/kyaml).
  • Refactor Gatekeeper validation output to use framework.Results and its built-in sorting.
  • Update example policies and golden E2E fixtures to reflect new schema/serialization and message formatting.

Reviewed changes

Copilot reviewed 12 out of 18 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
functions/go/gatekeeper/validate.go Switch validation parsing to Gatekeeper v3 gator results and emit framework.Results (includes sorting).
functions/go/gatekeeper/validate_test.go Update sorting test to use framework.Results.Sort() and new pointer/value field shapes.
functions/go/gatekeeper/main.go Migrate from resourceList.Result to resourceList.Results and propagate framework.Results on error.
functions/go/gatekeeper/go.mod Upgrade Go version + dependency set for the Gatekeeper function module.
functions/go/gatekeeper/go.sum Regenerated checksums after dependency upgrade.
functions/go/gatekeeper/tests/v1beta1-template/.expected/results.yaml Update expected stderr formatting to match new output.
functions/go/gatekeeper/tests/v1beta1-template/.expected/diff.patch Update golden patch output to match new formatting.
functions/go/gatekeeper/tests/jsonflag/.expected/diff.patch Update expected JSON structure for results (now array-style).
functions/go/gatekeeper/tests/inputoutputflags/resources/resources.yaml Reformat resource YAML (structure equivalent) for updated expectations.
functions/go/gatekeeper/tests/inputoutputflags/.expected/diff.patch Update golden output for results structure (list-style).
examples/gatekeeper-warning-only/policy.yaml Adjust OpenAPI schema to include type: object under openAPIV3Schema.
examples/gatekeeper-invalid-configmap/policy.yaml Adjust OpenAPI schema to include type: object under openAPIV3Schema.
examples/gatekeeper-invalid-configmap/.expected/results.yaml Update expected stderr formatting to match new output.
examples/gatekeeper-invalid-configmap/.expected/diff.patch Update golden patch output to match new formatting.
examples/gatekeeper-imperative/policy.yaml Adjust OpenAPI schema to include type: object under openAPIV3Schema.
examples/gatekeeper-imperative/.expected/results.yaml Update expected stderr formatting to match new output.
examples/gatekeeper-disallow-root-user/.expected/results.yaml Update expected stderr formatting to match new output.
examples/gatekeeper-disallow-root-user/.expected/diff.patch Update golden patch output to match new formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread functions/go/gatekeeper/validate.go
@aravindtga
Copy link
Copy Markdown
Contributor Author

License compliance is false positive. It reports go.opentelemetry.io/auto/sdk@v1.2.1 as LGPL-2.1-only but it is Apache license

image

@aravindtga aravindtga self-assigned this May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants