Skip to content

Fix/controller runtime api update#449

Open
pshickeydev wants to merge 3 commits into
openshift:masterfrom
pshickeydev:fix/controller-runtime-api-update
Open

Fix/controller runtime api update#449
pshickeydev wants to merge 3 commits into
openshift:masterfrom
pshickeydev:fix/controller-runtime-api-update

Conversation

@pshickeydev

@pshickeydev pshickeydev commented Jun 25, 2026

Copy link
Copy Markdown

Summary

  • Fix build failure caused by controller-runtime v0.24 API changes introduced in PR fix(deps): update gomod dependencies #445
  • Replace removed MetricsBindAddress and Port fields in ctrl.Options with their v0.19+ replacements: Metrics (metricsserver.Options) and WebhookServer (webhook.NewServer)

Context

Renovate PR #445 bumped sigs.k8s.io/controller-runtime from v0.15 to v0.24.1. This upgrade removed two fields from ctrl.Options that main.go was using:

./main.go:89:3: unknown field MetricsBindAddress in struct literal of type controllerruntime.Options
./main.go:90:3: unknown field Port in struct literal of type controllerruntime.Options

All four CI checks (images, test, coverage, lint) fail with these compile errors.

No CVEs or security advisories are associated with this controller-runtime upgrade — it is a routine dependency freshness bump.

Changes

main.go — 4 lines changed:

  • Added imports for sigs.k8s.io/controller-runtime/pkg/metrics/server and sigs.k8s.io/controller-runtime/pkg/webhook
  • Replaced MetricsBindAddress: metricsAddr with Metrics: metricsserver.Options{BindAddress: metricsAddr}
  • Replaced Port: 9443 with WebhookServer: webhook.NewServer(webhook.Options{Port: 9443})

Behavior is identical — same bind address, same port, same defaults.

Test plan

  • go build ./... passes
  • go vet ./... clean
  • go test ./... all tests pass
  • CI checks pass on PR

Summary by CodeRabbit

  • Chores
    • Updated the project’s runtime and dependency versions to newer releases.
    • Aligned the application with the latest supported manager configuration for improved compatibility with current tooling.

red-hat-konflux-kflux-prd-rh03 Bot and others added 2 commits June 25, 2026 04:10
Signed-off-by: red-hat-konflux-kflux-prd-rh03 <206760901+red-hat-konflux-kflux-prd-rh03[bot]@users.noreply.github.com>
MetricsBindAddress and Port were removed from ctrl.Options in
controller-runtime v0.19+. Use the replacement Metrics and
WebhookServer fields to fix the build.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (2)
  • build/Dockerfile is excluded by !build/**
  • build/Dockerfile.olm-registry is excluded by !build/**

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 3e7cb51a-a741-412c-8f2d-946154f2aeb0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

The PR bumps the Go toolchain, refreshes module versions and replace pins in go.mod, and updates controller-manager creation in main.go to use the newer metrics server and webhook server option structs.

Changes

Runtime and manager wiring refresh

Layer / File(s) Summary
Toolchain and dependency pin refresh
go.mod
go.mod bumps the Go directive, updates direct and indirect require versions, and changes the replace pins for github.com/openshift/api and sigs.k8s.io/json.
Manager metrics and webhook options
main.go
main.go adds metrics and webhook option imports and passes metricsserver.Options{BindAddress: metricsAddr} and webhook.NewServer(webhook.Options{Port: 9443}) to ctrl.NewManager.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error)

Check name Status Explanation Resolution
Container-Privileges ❌ Error PR adds manifest settings that permit privilege escalation: deploy_pko/SecurityContextConstraints-splunkforwarder.yaml sets allowPrivilegeEscalation: true and allowPrivilegedContainer: true. Remove or justify the privileged SCC settings, and ensure any container manifests avoid privileged/root/hostNamespace settings unless strictly required.
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: updating controller-runtime API usage to fix a build failure caused by deprecated fields.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed Only go.mod, go.sum, and main.go changed; no Ginkgo test titles were added or modified.
Test Structure And Quality ✅ Passed Only main.go changed; no Ginkgo test files or test logic were modified, so the test-quality criteria are not applicable.
Microshift Test Compatibility ✅ Passed PR only updates main.go/go.mod; no Ginkgo test declarations or MicroShift-sensitive APIs appear in the touched files.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR only updates go.mod and main.go; it adds no new Ginkgo e2e tests and makes no SNO-sensitive test assumptions.
Topology-Aware Scheduling Compatibility ✅ Passed PR only updates manager options and dependency pins; no pod anti-affinity, topology spread, nodeSelector, toleration, replica, or PDB changes.
Ote Binary Stdout Contract ✅ Passed main.go only updates manager options; no stdout writes were added in main/init/setup code.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR changes only go.mod and main.go; no new Ginkgo e2e tests were added, so IPv4/disconnected compatibility concerns are not introduced.
No-Weak-Crypto ✅ Passed Touched files only update controller options and dependency pins; no MD5/SHA1/DES/RC4, custom crypto, or secret/token comparisons found.
No-Sensitive-Data-In-Logs ✅ Passed No new logging was added in the PR; main.go only changes controller-runtime options, and existing logs are generic status/error messages without secrets or PII.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@openshift-ci openshift-ci Bot requested review from aliceh and tnierman June 25, 2026 17:28
@openshift-ci

openshift-ci Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pshickeydev

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 25, 2026
@codecov-commenter

codecov-commenter commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.44%. Comparing base (33a3a5a) to head (d127aa6).

Files with missing lines Patch % Lines
main.go 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #449   +/-   ##
=======================================
  Coverage   72.44%   72.44%           
=======================================
  Files          11       11           
  Lines         704      704           
=======================================
  Hits          510      510           
  Misses        173      173           
  Partials       21       21           
Files with missing lines Coverage Δ
main.go 0.00% <0.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

The boilerplate tooling updates the ubi9/ubi-minimal tag during
CI validation, causing a dirty checkout failure. Align the
Dockerfiles with the expected tag.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pshickeydev

Copy link
Copy Markdown
Author

/retest

@openshift-ci

openshift-ci Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@pshickeydev: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@pshickeydev

Copy link
Copy Markdown
Author

/retest-required

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants