Skip to content

Fix SSA for conditions#300

Merged
notandy merged 1 commit intomainfrom
ssa-server-merge
May 5, 2026
Merged

Fix SSA for conditions#300
notandy merged 1 commit intomainfrom
ssa-server-merge

Conversation

@fwiesel
Copy link
Copy Markdown
Contributor

@fwiesel fwiesel commented May 5, 2026

The struct tags on the conditions like patchStrategy:merge are the used by the k8s server proper, but they have no effect in controller-runtime. The corresponding annotations have been set instead, and you can see the effect in the generated crd declaration.

Summary by CodeRabbit

  • Refactor
    • Enhanced status condition handling for Eviction and Hypervisor resources to enable more efficient updates and improved support for concurrent modifications.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

Warning

Rate limit exceeded

@fwiesel has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 54 minutes and 54 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7d92fc0e-1ede-4df4-960b-bfdfa064238f

📥 Commits

Reviewing files that changed from the base of the PR and between 5ed8a54 and b9f45d1.

📒 Files selected for processing (4)
  • api/v1/eviction_types.go
  • api/v1/hypervisor_types.go
  • charts/openstack-hypervisor-operator/crds/kvm.cloud.sap_evictions.yaml
  • charts/openstack-hypervisor-operator/crds/kvm.cloud.sap_hypervisors.yaml
📝 Walkthrough

Walkthrough

This PR standardizes the treatment of Conditions fields across Go type definitions and Kubernetes CRD schemas by applying kubebuilder list-map annotations (+listType=map, +listMapKey=type) to enable Kubernetes to merge condition entries by their type field rather than treating the list as an unkeyed array.

Changes

Conditions List-Map Standardization

Layer / File(s) Summary
Go Type Annotations
api/v1/eviction_types.go, api/v1/hypervisor_types.go
Added kubebuilder directives +listType=map and +listMapKey=type to Conditions fields; hypervisor_types.go also removed legacy patchStrategy and protobuf struct tags in favor of the new annotation approach.
CRD Schema Extensions
charts/openstack-hypervisor-operator/crds/kvm.cloud.sap_evictions.yaml, charts/openstack-hypervisor-operator/crds/kvm.cloud.sap_hypervisors.yaml
Added OpenAPI extensions (x-kubernetes-list-map-keys: [type] and x-kubernetes-list-type: map) to status.conditions arrays in both Eviction and Hypervisor CRDs, reflecting the annotation-driven schema generation.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A rabbit bounds with glee so true, 🐰
Conditions merge—no more a queued brew!
By type they're keyed, conflicts now fade,
Kubernetes patches are smoothly made. ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix SSA for conditions' directly relates to the main changeset, which fixes Server-Side Apply (SSA) behavior for condition fields by replacing struct tags with kubebuilder annotations.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ssa-server-merge

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

fwiesel added a commit that referenced this pull request May 5, 2026
The struct tags on the conditions like `patchStrategy:merge` are the
used by the k8s server proper, but they have no effect in controller-runtime.
The corresponding annotations have been set instead, and you can
see the effect in the generated crd declaration.
@fwiesel fwiesel force-pushed the ssa-server-merge branch from 5ed8a54 to b9f45d1 Compare May 5, 2026 09:16
fwiesel added a commit that referenced this pull request May 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Merging this branch will not change overall coverage

Impacted Packages Coverage Δ 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/api/v1 0.00% (ø)

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/cobaltcore-dev/openstack-hypervisor-operator/api/v1/eviction_types.go 0.00% (ø) 0 0 0
github.com/cobaltcore-dev/openstack-hypervisor-operator/api/v1/hypervisor_types.go 0.00% (ø) 0 0 0

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

@notandy notandy merged commit c57c5be into main May 5, 2026
7 checks passed
@notandy notandy deleted the ssa-server-merge branch May 5, 2026 12:56
@coderabbitai coderabbitai Bot mentioned this pull request May 6, 2026
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.

2 participants