Skip to content

Upgrade to Go 1.26 and Operator SDK v1.39.1 - #116

Draft
michael-valdron wants to merge 2 commits into
devfile:mainfrom
michael-valdron:go1.26
Draft

michael-valdron wants to merge 2 commits into
devfile:mainfrom
michael-valdron:go1.26

Conversation

@michael-valdron

@michael-valdron michael-valdron commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Description of Changes

Upgrade the registry operator to Go 1.26 and Operator SDK v1.39.1 with the go/v4 layout and Kubernetes 1.31 dependencies.

  • Move the manager to cmd/ and controllers to internal/controller/, updating build and test paths.
  • Replace the unavailable gcr.io/kubebuilder/kube-rbac-proxy sidecar with controller-runtime's authenticated HTTPS metrics endpoint.
  • Update the pinned UBI9 Go builder, CI tools, versioned development tools, scorecard images, and generated bundle.
  • Modernize Kustomize configuration, add installer generation and opt-in NetworkPolicies, and document the migration and supported versions.

Related Issue(s)

Acceptance Criteria

Tests

  • Test Coverage
    • Existing local suites pass; added metrics authentication and authorization regression coverage.
  • Gosec scans
    • Final scan and review of MEDIUM and higher findings remain to be completed for the full migration.

Documentation

  • Does the registry operator documentation need to be updated with your changes?
    • Updated README and cluster support documentation; added SDK_MIGRATION.md with migration details and compatibility notes.

Tests Performed

  • Compiled all packages, including cluster integration test packages.
  • Ran make test with Kubernetes 1.31.0 envtest assets: 16 webhook specs, 6 controller specs, package tests, and metrics authorization tests passed.
  • Ran generation, formatting, go vet, make all, and module tidiness checks.
  • Rendered the default manifests and the opt-in NetworkPolicy configuration; checked metrics/webhook ports and selectors.
  • Regenerated the bundle with Operator SDK v1.39.1 and passed operator-sdk bundle validate ./bundle, preserving all three CR examples.
  • Built the operator container successfully with Podman and the pinned UBI9 Go 1.26 builder.

Live-cluster integration tests, scorecard execution, and OpenShift deployment were not run as part of this change.

How To Test

Using Go 1.26 and Operator SDK v1.39.1:

make test
make all
make build-installer IMG=<operator-image>
operator-sdk bundle validate ./bundle
make podman-build IMG=<operator-image>

For cluster testing, deploy the built image and verify registry reconciliation and admission webhooks. Check that HTTPS metrics on port 8443 reject anonymous requests and authenticated callers without /metrics permission, and allow an authorized monitoring service account.

The NetworkPolicies are opt-in. Before enabling them, configure the webhook policy for the cluster's API-server source network and label monitoring namespaces metrics=enabled.

Running Unit Tests

Running Integration Tests

Notes To Reviewer

  • The SDK migration guide's older controller generator is incompatible with Go 1.26, so controller-gen v0.23.0 is retained.
  • The webhook NetworkPolicy targets the actual container port 9443, rather than Service port 443. Admission requests originate from the API server; the policy's source selector must be adapted before enabling it.
  • The existing SDK/Kustomize issue still drops the two *List examples during bundle regeneration. They are restored in the checked-in bundle; the workaround is documented in SDK_MIGRATION.md.
  • The Go update issue spans multiple repositories; this PR covers registry-operator only.

Update the UBI9 builder, CI tools, and controller generator for Go 1.26. Regenerate CRDs and RBAC and refresh development documentation.

Assisted-by: GPT-6
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Adopt the go/v4 layout, Kubernetes 1.31 dependencies, and versioned build tools. Replace kube-rbac-proxy with authenticated manager metrics, add optional network policies, and regenerate the bundle and scorecard configuration.

Validated local tests, metrics authorization, manifest rendering, bundle validation, and the container build.

Assisted-by: GPT-6
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
@openshift-ci

openshift-ci Bot commented Oct 20, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci

openshift-ci Bot commented Oct 20, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: michael-valdron

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Oct 20, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@michael-valdron

Copy link
Copy Markdown
Member Author

These changes seem to resolve devfile/api#1797 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant