Upgrade to new kube api and go update#34
Conversation
📝 WalkthroughWalkthroughBumps Go from 1.25.5 → 1.26.2 in build and module directives, refreshes many direct and indirect dependencies, migrates webhook handlers to typed, context-aware signatures, and applies small import and file-header/license comment updates across charts and examples. ChangesDependency & Webhook Modernization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
pkg/webhook/v1alpha1/remotearbiter_webhook.go (1)
68-83: ⚡ Quick winInconsistent unused-parameter handling: use
_forctx(andoldObj) to matchremotecluster_webhook.go.
remotecluster_webhook.goblanks its unused context parameters with_ context.Context, while these methods use the namedctx. Line 74 additionally hasoldObjnamed but discarded. If the project'sgolangci-lintconfig enablesrevive'sunused-parameterrule, these will fail linting.♻️ Proposed fix
-func (r *RemoteArbiterCustomValidator) ValidateCreate(ctx context.Context, remoteArbiter *v1alpha1.RemoteArbiter) (warnings admission.Warnings, err error) { +func (r *RemoteArbiterCustomValidator) ValidateCreate(_ context.Context, remoteArbiter *v1alpha1.RemoteArbiter) (admission.Warnings, error) { -func (r *RemoteArbiterCustomValidator) ValidateUpdate(ctx context.Context, oldObj, remoteArbiter *v1alpha1.RemoteArbiter) (warnings admission.Warnings, err error) { +func (r *RemoteArbiterCustomValidator) ValidateUpdate(_ context.Context, _, remoteArbiter *v1alpha1.RemoteArbiter) (admission.Warnings, error) { -func (r *RemoteArbiterCustomValidator) ValidateDelete(ctx context.Context, remoteArbiter *v1alpha1.RemoteArbiter) (warnings admission.Warnings, err error) { +func (r *RemoteArbiterCustomValidator) ValidateDelete(_ context.Context, remoteArbiter *v1alpha1.RemoteArbiter) (admission.Warnings, error) {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/webhook/v1alpha1/remotearbiter_webhook.go` around lines 68 - 83, The functions ValidateCreate, ValidateUpdate, and ValidateDelete currently declare an unused ctx parameter (and ValidateUpdate also declares an unused oldObj), which will trigger unused-parameter lint rules; update their signatures to use blank identifiers for unused parameters—replace ctx context.Context with _ context.Context in ValidateCreate/ValidateUpdate/ValidateDelete and replace oldObj, remoteArbiter *v1alpha1.RemoteArbiter with _ *v1alpha1.RemoteArbiter, remoteArbiter *v1alpha1.RemoteArbiter (or just change oldObj to _ *v1alpha1.RemoteArbiter) in ValidateUpdate—leave function bodies and return types unchanged (references: ValidateCreate, ValidateUpdate, ValidateDelete).pkg/webhook/v1alpha1/remotecluster_webhook.go (1)
81-83: ⚡ Quick win
oldObjis named but unused — should be_.The context is correctly blanked with
_ context.Context, but the previous-object parameter is still namedoldObjwithout being referenced. This mirrors the same concern inremotearbiter_webhook.go; rename to_for consistency.♻️ Proposed fix
-func (r *RemoteClusterCustomValidator) ValidateUpdate(_ context.Context, oldObj, remoteCluster *v1alpha1.RemoteCluster) (admission.Warnings, error) { +func (r *RemoteClusterCustomValidator) ValidateUpdate(_ context.Context, _, remoteCluster *v1alpha1.RemoteCluster) (admission.Warnings, error) {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@pkg/webhook/v1alpha1/remotecluster_webhook.go` around lines 81 - 83, Rename the unused parameter oldObj to _ in the RemoteClusterCustomValidator.ValidateUpdate signature so the compiler knows it's intentionally unused; update the function signature from ValidateUpdate(_ context.Context, oldObj, remoteCluster *v1alpha1.RemoteCluster) to ValidateUpdate(_ context.Context, _, remoteCluster *v1alpha1.RemoteCluster) (keeping remoteCluster and the rest of the method body unchanged) to match the pattern used in remotearbiter_webhook.go.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@pkg/webhook/v1alpha1/remotearbiter_webhook.go`:
- Around line 68-83: The functions ValidateCreate, ValidateUpdate, and
ValidateDelete currently declare an unused ctx parameter (and ValidateUpdate
also declares an unused oldObj), which will trigger unused-parameter lint rules;
update their signatures to use blank identifiers for unused parameters—replace
ctx context.Context with _ context.Context in
ValidateCreate/ValidateUpdate/ValidateDelete and replace oldObj, remoteArbiter
*v1alpha1.RemoteArbiter with _ *v1alpha1.RemoteArbiter, remoteArbiter
*v1alpha1.RemoteArbiter (or just change oldObj to _ *v1alpha1.RemoteArbiter) in
ValidateUpdate—leave function bodies and return types unchanged (references:
ValidateCreate, ValidateUpdate, ValidateDelete).
In `@pkg/webhook/v1alpha1/remotecluster_webhook.go`:
- Around line 81-83: Rename the unused parameter oldObj to _ in the
RemoteClusterCustomValidator.ValidateUpdate signature so the compiler knows it's
intentionally unused; update the function signature from ValidateUpdate(_
context.Context, oldObj, remoteCluster *v1alpha1.RemoteCluster) to
ValidateUpdate(_ context.Context, _, remoteCluster *v1alpha1.RemoteCluster)
(keeping remoteCluster and the rest of the method body unchanged) to match the
pattern used in remotearbiter_webhook.go.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 05f7fbc7-8a3c-4fc4-bfe7-632b87a671ee
⛔ Files ignored due to path filters (1)
go.sumis excluded by!**/*.sum
📒 Files selected for processing (5)
Dockerfilego.modpkg/api/arbiter/v1alpha1/zz_generated.deepcopy.gopkg/webhook/v1alpha1/remotearbiter_webhook.gopkg/webhook/v1alpha1/remotecluster_webhook.go
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@LICENSES/Apache-2.0.txt`:
- Line 15: The LICENSE line contains a typo changing the canonical Apache-2.0
token "You" to "Y ou"; restore the exact standard wording by replacing the
string "Y ou" with "You" so the license matches the canonical Apache-2.0 text
(ensure the phrase reads `"You" (or "Your") shall mean an individual or Legal
Entity exercising permissions granted by this License.`).
🪄 Autofix (Beta)
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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1ffaadd2-58c4-4aef-b3f0-97af9455060b
📒 Files selected for processing (11)
LICENSES/Apache-2.0.txtREUSE.tomlcontrib/charts/external-arbiter-operator/.helmignorecontrib/charts/external-arbiter-operator/templates/_helpers.tplcontrib/k8s/examples/remote-arbiter.yamlcontrib/k8s/examples/remote-cluster.yamlcontrib/k8s/examples/secret.yamlcontrib/k8s/test/env-var-secret.yamlcontrib/k8s/test/keyring-secret.yamlcontrib/k8s/test/mon-deployment.yamlcontrib/k8s/test/override-configmap.yaml
✅ Files skipped from review due to trivial changes (10)
- contrib/k8s/examples/remote-cluster.yaml
- contrib/charts/external-arbiter-operator/.helmignore
- REUSE.toml
- contrib/k8s/test/env-var-secret.yaml
- contrib/k8s/test/mon-deployment.yaml
- contrib/k8s/examples/remote-arbiter.yaml
- contrib/k8s/test/keyring-secret.yaml
- contrib/k8s/examples/secret.yaml
- contrib/charts/external-arbiter-operator/templates/_helpers.tpl
- contrib/k8s/test/override-configmap.yaml
| "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. | ||
|
|
||
| "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. | ||
| "Y ou" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. |
There was a problem hiding this comment.
Restore canonical Apache-2.0 text ("You"), typo introduces compliance risk.
Line 15 changes the legal term from "You" to "Y ou". For license files, exact canonical wording matters for legal clarity and automated compliance tooling (SPDX/license scanners). Please revert this to the standard Apache-2.0 text.
Proposed fix
-"Y ou" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "Y ou" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. | |
| "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@LICENSES/Apache-2.0.txt` at line 15, The LICENSE line contains a typo
changing the canonical Apache-2.0 token "You" to "Y ou"; restore the exact
standard wording by replacing the string "Y ou" with "You" so the license
matches the canonical Apache-2.0 text (ensure the phrase reads `"You" (or
"Your") shall mean an individual or Legal Entity exercising permissions granted
by this License.`).
There was a problem hiding this comment.
I think this is a small typo, can you fix it
There was a problem hiding this comment.
@senolcolak, sure! This is a straightforward fix — the space in "Y ou" needs to be removed to restore the canonical Apache-2.0 wording.
- Fix typo
"Y ou"→"You"inLICENSES/Apache-2.0.txtat line 15
- 📌 Commit the changes to this branch
Summary by CodeRabbit