NO-ISSUE: modernise the codebase using go fix - #3113
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@skitt: This pull request explicitly references no jira issue. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
Summary by CodeRabbit
WalkthroughThe change modernizes Go syntax across controller, network, HyperShift, rendering, and test code. It replaces ChangesGo language modernization
Estimated code review effort: 2 (Simple) | ~15 minutes Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (2 errors, 1 warning)
✅ Passed checks (21 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/network/ovn_kubernetes_test.go`:
- Line 1300: Replace the informal comment “set geneve port to insanity” with a
concise technical comment describing that the test configures an invalid Geneve
port value.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: d7cfc44a-7442-497f-ba5b-5a57481d0b43
📒 Files selected for processing (31)
cmd/cluster-network-operator/mtu_probe.gopkg/apply/apply.gopkg/cmd/checkendpoints/controller/backoff_recorder.gopkg/cmd/checkendpoints/controller/backoff_recorder_test.gopkg/cmd/checkendpoints/controller/connection_checker.gopkg/cmd/checkendpoints/controller/connection_checker_test.gopkg/controller/eventrecorder/event_recorder.gopkg/controller/infrastructureconfig/validations.gopkg/controller/observability/observability_controller.gopkg/controller/observability/observability_controller_test.gopkg/controller/proxyconfig/validation.gopkg/controller/statusmanager/kube.gopkg/controller/statusmanager/status_manager.gopkg/hypershift/hypershift.gopkg/hypershift/hypershift_test.gopkg/network/additional_networks.gopkg/network/bootstrap_test.gopkg/network/cloud_network_test.gopkg/network/mtu.gopkg/network/mtu_unsupported.gopkg/network/multus_ipam.gopkg/network/ovn_kubernetes.gopkg/network/ovn_kubernetes_dpu_host_test.gopkg/network/ovn_kubernetes_test.gopkg/network/testutil_test.gopkg/network/tls.gopkg/network/tls_test.gopkg/render/funcs.gopkg/render/render.gopkg/util/k8s/unstructured.gopkg/util/proxyconfig/no_proxy.go
💤 Files with no reviewable changes (2)
- pkg/network/mtu.go
- pkg/network/mtu_unsupported.go
|
/lgtm |
|
@danwinship: This PR has been marked as verified by DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
Scheduling required tests: Scheduling tests matching the |
|
@skitt: This pull request explicitly references no jira issue. DetailsIn response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
This improves readability and allows removing loop counters in some cases. Signed-off-by: Stephen Kitt <skitt@redhat.com>
This is more concise. Signed-off-by: Stephen Kitt <skitt@redhat.com>
This avoids open-coding and allows the project to benefit from stdlib improvements in future. Signed-off-by: Stephen Kitt <skitt@redhat.com>
This is more efficient than strings.Split, it avoids creating a slice. Signed-off-by: Stephen Kitt <skitt@redhat.com>
This allows a number of functions to be removed. Signed-off-by: Stephen Kitt <skitt@redhat.com>
This avoids going through a string type conversion. Signed-off-by: Stephen Kitt <skitt@redhat.com>
There are unnecessary. Signed-off-by: Stephen Kitt <skitt@redhat.com>
This improves readability. Signed-off-by: Stephen Kitt <skitt@redhat.com>
|
@skitt: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
@coderabbitai review |
|
|
/lgtm |
|
Scheduling required tests: Scheduling tests matching the |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: danwinship, skitt The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Why
Go now provides a built-in fix-up tool,
go fix. It is intended to apply safe fixes which use newer code patterns to improve maintenability and/or performance.What
This is a one-time
go fixrun over the project, simplifying more regular maintenance usinggo fixin future.See individual commits for details.
Verification
This is a refactor with no behaviour changes, so existing tests don’t need adjusting and should be sufficient to verify correctness.