Skip to content

Remove deprecated APIVersion, Kind, and UID fields from ObjectReference types#885

Open
afritzler wants to merge 1 commit into
mainfrom
chore/remove-deprecated-refs
Open

Remove deprecated APIVersion, Kind, and UID fields from ObjectReference types#885
afritzler wants to merge 1 commit into
mainfrom
chore/remove-deprecated-refs

Conversation

@afritzler
Copy link
Copy Markdown
Member

@afritzler afritzler commented May 13, 2026

Proposed Changes

Remove deprecated APIVersion, Kind, and UID fields from ObjectReference and ImmutableObjectReference structs along with all associated cleanup

The deprecated fields (APIVersion, Kind, UID) were previously retained for backwards compatibility but are no longer needed. This removes:

  • The fields from the API types and apply configurations
  • The clearDeprecatedObjectRefFields/clearDeprecatedImmutableObjectRefFields helper functions
  • All controller reconciliation logic that patched objects to clear these fields
  • The corresponding API documentation entries

Fixes #884

Summary by CodeRabbit

  • Breaking Changes

    • Removed deprecated metadata fields (apiVersion, kind, uid) from object references across the API. References now support only name and namespace for identifying resources.
    • Updated all Custom Resource Definitions to reflect the simplified reference schema.
  • Documentation

    • Updated API reference documentation to reflect simplified reference types.

Review Change Stack

@afritzler afritzler requested a review from a team as a code owner May 13, 2026 07:04
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: df642873-d73d-4dcc-9b84-1e924554ea19

📥 Commits

Reviewing files that changed from the base of the PR and between ee244f2 and 9e52462.

⛔ Files ignored due to path filters (5)
  • dist/chart/templates/crd/metal.ironcore.dev_biossettings.yaml is excluded by !**/dist/**
  • dist/chart/templates/crd/metal.ironcore.dev_biosversions.yaml is excluded by !**/dist/**
  • dist/chart/templates/crd/metal.ironcore.dev_bmcsettings.yaml is excluded by !**/dist/**
  • dist/chart/templates/crd/metal.ironcore.dev_bmcversions.yaml is excluded by !**/dist/**
  • dist/chart/templates/crd/metal.ironcore.dev_servers.yaml is excluded by !**/dist/**
📒 Files selected for processing (15)
  • api/v1alpha1/applyconfiguration/api/v1alpha1/immutableobjectreference.go
  • api/v1alpha1/applyconfiguration/api/v1alpha1/objectreference.go
  • api/v1alpha1/common_types.go
  • config/crd/bases/metal.ironcore.dev_biossettings.yaml
  • config/crd/bases/metal.ironcore.dev_biosversions.yaml
  • config/crd/bases/metal.ironcore.dev_bmcsettings.yaml
  • config/crd/bases/metal.ironcore.dev_bmcversions.yaml
  • config/crd/bases/metal.ironcore.dev_servers.yaml
  • docs/api-reference/api.md
  • internal/controller/biossettings_controller.go
  • internal/controller/biosversion_controller.go
  • internal/controller/bmcsettings_controller.go
  • internal/controller/bmcversion_controller.go
  • internal/controller/helper.go
  • internal/controller/server_controller.go
💤 Files with no reviewable changes (15)
  • config/crd/bases/metal.ironcore.dev_biosversions.yaml
  • docs/api-reference/api.md
  • config/crd/bases/metal.ironcore.dev_biossettings.yaml
  • internal/controller/biosversion_controller.go
  • internal/controller/bmcversion_controller.go
  • internal/controller/server_controller.go
  • config/crd/bases/metal.ironcore.dev_bmcsettings.yaml
  • config/crd/bases/metal.ironcore.dev_bmcversions.yaml
  • internal/controller/helper.go
  • config/crd/bases/metal.ironcore.dev_servers.yaml
  • api/v1alpha1/common_types.go
  • api/v1alpha1/applyconfiguration/api/v1alpha1/immutableobjectreference.go
  • internal/controller/bmcsettings_controller.go
  • internal/controller/biossettings_controller.go
  • api/v1alpha1/applyconfiguration/api/v1alpha1/objectreference.go

📝 Walkthrough

Walkthrough

This PR completes the deprecation cycle for APIVersion, Kind, and UID fields on ObjectReference and ImmutableObjectReference by removing them from type definitions, generated apply-configuration types, CRD schemas, and API documentation, and by eliminating controller-based field-clearing migration logic that is no longer needed.

Changes

Deprecated field removal across API types and controllers

Layer / File(s) Summary
API type contracts
api/v1alpha1/common_types.go
ObjectReference and ImmutableObjectReference are simplified to only declare Namespace and Name fields. ImmutableObjectReference gains kubebuilder validation constraints and XValidation immutability rules.
Apply configuration types
api/v1alpha1/applyconfiguration/api/v1alpha1/immutableobjectreference.go, api/v1alpha1/applyconfiguration/api/v1alpha1/objectreference.go
Generated apply-configuration structs remove deprecated APIVersion, Kind, and UID fields and their corresponding fluent builder methods (WithAPIVersion, WithKind, WithUID).
CRD schema definitions
config/crd/bases/metal.ironcore.dev_biossettings.yaml, config/crd/bases/metal.ironcore.dev_biosversions.yaml, config/crd/bases/metal.ironcore.dev_bmcsettings.yaml, config/crd/bases/metal.ironcore.dev_bmcversions.yaml, config/crd/bases/metal.ironcore.dev_servers.yaml
All reference object schemas are simplified to only define name and namespace properties (both required), removing deprecated apiVersion, kind, and uid fields from CRD OpenAPI definitions.
API reference documentation
docs/api-reference/api.md
ObjectReference and ImmutableObjectReference documentation tables are updated to remove deprecated field entries.
Controller migration logic removal
internal/controller/helper.go, internal/controller/biossettings_controller.go, internal/controller/biosversion_controller.go, internal/controller/bmcsettings_controller.go, internal/controller/bmcversion_controller.go, internal/controller/server_controller.go
Deprecated field-clearing helper functions and all early-patch-and-exit migration passes are removed from controller reconciliation loops, simplifying the reconciliation flow to proceed directly to finalizer and state-transition logic.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • ironcore-dev/metal-operator#748: Introduced the optional/deprecated APIVersion, Kind, and UID fields and the field-clearing migration logic that this PR now removes.
  • ironcore-dev/metal-operator#653: Modified biossettings_controller.go reconcile flow around serverMaintenanceRef handling, which overlaps with the field-clearing logic removal in this PR.

Suggested labels

deprecation

Suggested reviewers

  • stefanhipfel
  • nagadeesh-nagaraja
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: removing deprecated fields from ObjectReference types.
Description check ✅ Passed The description covers the main changes, references the issue, but lacks specific file/line details; however, it adequately communicates the scope and purpose of the PR.
Linked Issues check ✅ Passed All objectives from issue #884 are met: deprecated fields removed from types and apply-configs, helper functions deleted, controller logic cleaned up, CRDs and docs updated.
Out of Scope Changes check ✅ Passed All changes directly address the requirements in issue #884; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/remove-deprecated-refs

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.

@github-actions github-actions Bot added size/L api-change chore documentation Improvements or additions to documentation labels May 13, 2026
@afritzler afritzler force-pushed the chore/remove-deprecated-refs branch from 598de6e to fb88397 Compare May 13, 2026 07:06
@afritzler afritzler requested a review from maxmoehl May 13, 2026 07:06
…ce types

Remove deprecated APIVersion, Kind, and UID fields from ObjectReference
and ImmutableObjectReference structs along with all associated cleanup

The deprecated fields (APIVersion, Kind, UID) were previously retained
for backwards compatibility but are no longer needed. This removes:
- The fields from the API types and apply configurations
- The clearDeprecatedObjectRefFields/clearDeprecatedImmutableObjectRefFields
  helper functions
- All controller reconciliation logic that patched objects to clear these fields
- The corresponding API documentation entries

Signed-off-by: Andreas Fritzler <andreas.fritzler@sap.com>
@afritzler afritzler force-pushed the chore/remove-deprecated-refs branch from fb88397 to 9e52462 Compare May 13, 2026 07:08
@afritzler
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 13, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Remove deprecated APIVersion, Kind, UID fields and migration logic from ObjectReferences

2 participants