Skip to content

Upgrade to new kube api and go update#34

Merged
costa-labs merged 3 commits into
cobaltcore-dev:mainfrom
costa-labs:api_go_update_1.26.2
May 5, 2026
Merged

Upgrade to new kube api and go update#34
costa-labs merged 3 commits into
cobaltcore-dev:mainfrom
costa-labs:api_go_update_1.26.2

Conversation

@costa-labs
Copy link
Copy Markdown
Collaborator

@costa-labs costa-labs commented May 2, 2026

Summary by CodeRabbit

  • Chores
    • Upgraded Go to 1.26.2 in build and project config and refreshed core and indirect dependencies for improved compatibility.
  • Refactor
    • Improved webhook validation/defaulter implementations to use typed, context-aware interfaces for clearer runtime behavior.
  • Documentation
    • Added/standardized copyright and SPDX license headers across charts, examples, and test manifests.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 2, 2026

📝 Walkthrough

Walkthrough

Bumps 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.

Changes

Dependency & Webhook Modernization

Layer / File(s) Summary
Build / Go directive
Dockerfile, go.mod
Builder image updated to golang:1.26.2; go directive changed to 1.26.2.
Module dependencies
go.mod
Top-level and many indirect requirements refreshed (e.g., sigs.k8s.io/controller-runtime → v0.23.3, k8s.io/*, OpenTelemetry, tooling and linting deps).
Webhook registration wiring
pkg/webhook/v1alpha1/remotearbiter_webhook.go, pkg/webhook/v1alpha1/remotecluster_webhook.go
Webhook builders now called with the target type (ctrl.NewWebhookManagedBy(mgr, &v1alpha1.RemoteArbiter{}) / ...RemoteCluster{}) instead of .For(...) chaining.
Webhook handler signatures
pkg/webhook/v1alpha1/remotearbiter_webhook.go, pkg/webhook/v1alpha1/remotecluster_webhook.go
Defaulter/Validator methods migrated from runtime.Object-based signatures with runtime type assertions to typed signatures accepting context.Context and *v1alpha1.<Type>, removing assertion/error branches.
Generated import alignment
pkg/api/arbiter/v1alpha1/zz_generated.deepcopy.go
Import for k8s.io/api/core/v1 changed to explicit alias v1 to match in-file type usage.
REUSE / license headers
REUSE.toml, LICENSES/Apache-2.0.txt, contrib/... (charts, examples, test YAMLs, templates)
Inserted/updated SPDX/license header comments in several chart/template/example/test files; REUSE.toml annotation paths adjusted; a minor textual edit in LICENSES/Apache-2.0.txt.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

"I nibble lines of Go and hop with glee,
Updated versions and webhooks set free,
Imports aligned and headers in place,
A tidy patch from my rabbitly space. 🐇"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Upgrade to new kube api and go update' accurately reflects the main changes: upgrading Go from 1.25 to 1.26.2 and updating Kubernetes API dependencies to newer versions.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
pkg/webhook/v1alpha1/remotearbiter_webhook.go (1)

68-83: ⚡ Quick win

Inconsistent unused-parameter handling: use _ for ctx (and oldObj) to match remotecluster_webhook.go.

remotecluster_webhook.go blanks its unused context parameters with _ context.Context, while these methods use the named ctx. Line 74 additionally has oldObj named but discarded. If the project's golangci-lint config enables revive's unused-parameter rule, 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

oldObj is named but unused — should be _.

The context is correctly blanked with _ context.Context, but the previous-object parameter is still named oldObj without being referenced. This mirrors the same concern in remotearbiter_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

📥 Commits

Reviewing files that changed from the base of the PR and between 4970601 and 41038a8.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (5)
  • Dockerfile
  • go.mod
  • pkg/api/arbiter/v1alpha1/zz_generated.deepcopy.go
  • pkg/webhook/v1alpha1/remotearbiter_webhook.go
  • pkg/webhook/v1alpha1/remotecluster_webhook.go

Copy link
Copy Markdown
Collaborator

@senolcolak senolcolak left a comment

Choose a reason for hiding this comment

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

LGTM

@costa-labs costa-labs changed the title Uopgrade to new kube api and go update Upgrade to new kube api and go update May 4, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 41038a8 and 19b4484.

📒 Files selected for processing (11)
  • LICENSES/Apache-2.0.txt
  • REUSE.toml
  • contrib/charts/external-arbiter-operator/.helmignore
  • contrib/charts/external-arbiter-operator/templates/_helpers.tpl
  • contrib/k8s/examples/remote-arbiter.yaml
  • contrib/k8s/examples/remote-cluster.yaml
  • contrib/k8s/examples/secret.yaml
  • contrib/k8s/test/env-var-secret.yaml
  • contrib/k8s/test/keyring-secret.yaml
  • contrib/k8s/test/mon-deployment.yaml
  • contrib/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

Comment thread LICENSES/Apache-2.0.txt
"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.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot May 4, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.

Suggested change
"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.`).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this is a small typo, can you fix it

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@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" in LICENSES/Apache-2.0.txt at line 15

  • 📌 Commit the changes to this branch

@costa-labs costa-labs merged commit efa11a6 into cobaltcore-dev:main May 5, 2026
3 checks passed
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.

3 participants