Skip to content

Deprecate the Endpoint resource#1019

Open
afritzler wants to merge 2 commits into
ironcore-dev:mainfrom
afritzler:enh/endpoint-deprecation
Open

Deprecate the Endpoint resource#1019
afritzler wants to merge 2 commits into
ironcore-dev:mainfrom
afritzler:enh/endpoint-deprecation

Conversation

@afritzler

@afritzler afritzler commented Jul 15, 2026

Copy link
Copy Markdown
Member

Proposed Changes

Deprecate the Endpoint resource.

Fixes #1018

Summary by CodeRabbit

  • Deprecation

    • The Endpoint resource and BMC.spec.endpointRef are now marked as deprecated (including CRD/API schema deprecation messaging).
    • New configurations should specify network access inline via BMC.spec.access (using an InlineEndpoint with MAC address and IP).
    • Creating or updating deprecated Endpoint resources may surface an admission warning; existing deprecated resources remain supported for compatibility.
  • Documentation

    • Updated API reference, endpoint concepts, and CRD field descriptions with migration guidance.
    • Clarified server maintenance behavior in examples and adjusted metalctl move dry-run instructions formatting.

@afritzler
afritzler requested a review from a team as a code owner July 15, 2026 15:09
@github-actions github-actions Bot added api-change documentation Improvements or additions to documentation enhancement New feature or request labels Jul 15, 2026
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: 6f135887-e4fa-4035-8c5e-72522eb94d04

📥 Commits

Reviewing files that changed from the base of the PR and between ec71469 and 97f01a2.

⛔ Files ignored due to path filters (2)
  • dist/chart/templates/crd/metal.ironcore.dev_bmcs.yaml is excluded by !**/dist/**
  • dist/chart/templates/crd/metal.ironcore.dev_endpoints.yaml is excluded by !**/dist/**
📒 Files selected for processing (12)
  • .golangci.yml
  • api/v1alpha1/applyconfiguration/api/v1alpha1/bmcspec.go
  • api/v1alpha1/applyconfiguration/api/v1alpha1/endpoint.go
  • api/v1alpha1/bmc_types.go
  • api/v1alpha1/endpoint_types.go
  • config/crd/bases/metal.ironcore.dev_bmcs.yaml
  • config/crd/bases/metal.ironcore.dev_endpoints.yaml
  • docs/api-reference/api.md
  • docs/concepts/endpoints.md
  • docs/concepts/servermaintenance.md
  • docs/concepts/servers.md
  • docs/usage/metalctl.md
🚧 Files skipped from review as they are similar to previous changes (10)
  • api/v1alpha1/bmc_types.go
  • docs/concepts/endpoints.md
  • api/v1alpha1/applyconfiguration/api/v1alpha1/bmcspec.go
  • docs/concepts/servers.md
  • api/v1alpha1/applyconfiguration/api/v1alpha1/endpoint.go
  • docs/usage/metalctl.md
  • api/v1alpha1/endpoint_types.go
  • docs/concepts/servermaintenance.md
  • config/crd/bases/metal.ironcore.dev_bmcs.yaml
  • docs/api-reference/api.md

📝 Walkthrough

Walkthrough

The PR marks the Endpoint resource and BMC.spec.endpointRef path as deprecated, directs callers to inline BMC.spec.access, updates CRD and API documentation, and suppresses staticcheck warnings for retained legacy compatibility.

Changes

Endpoint deprecation contract

Layer / File(s) Summary
Deprecation contract and CRD schemas
api/v1alpha1/..., config/crd/bases/*
API comments and CRD metadata identify Endpoint and endpointRef as deprecated and recommend inline BMC.spec.access with InlineEndpoint data.

Documentation and compatibility support

Layer / File(s) Summary
Documentation and lint support
docs/..., .golangci.yml
Endpoint replacement guidance is added to API and concept documentation, supporting Markdown content is adjusted, and staticcheck exclusions retain legacy API usage.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • #1023 — This PR adds deprecation notices and compatibility suppressions that precede removal of the same resources and references.
  • #1022 — This PR deprecates the Endpoint and endpointRef paths addressed by the related owner-reference removal work.

Suggested labels: area/metal-automation

Suggested reviewers: xkonni

🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The deprecation docs are updated, but the required EndpointCustomValidator warning on create/update is not shown in the changes. Add the validator change so create/update emits a Warning without rejecting requests, and include evidence or tests for it.
Out of Scope Changes check ⚠️ Warning Several docs edits in servermaintenance, servers, and metalctl appear unrelated to Endpoint deprecation and likely out of scope. Remove or justify the unrelated documentation changes, or split them into a separate pull request.
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately summarizes the main change: deprecating the Endpoint resource.
Description check ✅ Passed The description covers the core change and linked issue, but it is lighter than the template's requested detail.
✨ 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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@config/crd/bases/metal.ironcore.dev_endpoints.yaml`:
- Around line 32-37: Keep the Endpoint deprecation text in the API definition in
endpoint_types.go, revert the direct edit to the generated CRD, and run make
manifests to regenerate the corresponding config/crd/bases artifact.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bb961332-52ba-4b4b-b893-3e5a55db5562

📥 Commits

Reviewing files that changed from the base of the PR and between 9bc5784 and bf726ac.

⛔ Files ignored due to path filters (1)
  • dist/chart/templates/crd/metal.ironcore.dev_endpoints.yaml is excluded by !**/dist/**
📒 Files selected for processing (10)
  • .golangci.yml
  • api/v1alpha1/applyconfiguration/api/v1alpha1/endpoint.go
  • api/v1alpha1/endpoint_types.go
  • config/crd/bases/metal.ironcore.dev_endpoints.yaml
  • docs/api-reference/api.md
  • docs/concepts/endpoints.md
  • docs/concepts/servermaintenance.md
  • docs/concepts/servers.md
  • docs/usage/metalctl.md
  • internal/webhook/v1alpha1/endpoint_webhook.go

Comment thread config/crd/bases/metal.ironcore.dev_endpoints.yaml
@afritzler

Copy link
Copy Markdown
Member Author

@coderabbitai create an issue for remove the OwnerReference dependency between the Endpoints and BMCs as this will be needed to prevent the GC to remove BMC and all subsequent objects when deleting the Endpoints going forward.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
gh issue create \
  --repo ironcore-dev/metal-operator \
  --title "Remove OwnerReference dependency between Endpoint and BMC" \
  --assignee afritzler \
  --body "## Summary
Remove the \`OwnerReference\` relationship currently established between \`Endpoint\` and \`BMC\` resources.

## Rationale
With the \`Endpoint\` resource now deprecated (see PR `#1019` and issue `#1018`) in favor of modeling endpoint information inline via \`BMC.spec.access\`, the existing \`OwnerReference\` from \`BMC\` to \`Endpoint\` (or vice versa) creates an unwanted side effect: Kubernetes garbage collection (GC) will delete the \`BMC\` object and all its dependent resources whenever the owning \`Endpoint\` is deleted. This is undesirable going forward since \`Endpoint\` is being phased out and should not be able to cascade-delete \`BMC\` and downstream objects.

## Affected areas
- Controllers/reconcilers that set the \`OwnerReference\` between \`Endpoint\` and \`BMC\` (likely in \`internal/controller\` for the BMC/Endpoint reconciliation logic).
- Any related webhook or validation logic in \`internal/webhook/v1alpha1\`.

## Acceptance criteria
- \`BMC\` objects no longer carry an \`OwnerReference\` pointing to their associated \`Endpoint\`.
- Deleting an \`Endpoint\` no longer triggers garbage collection of the associated \`BMC\` and its subsequent objects.
- Existing tests are updated/added to verify that deleting an \`Endpoint\` does not cascade-delete the \`BMC\`.

## References
- PR: https://github.com/ironcore-dev/metal-operator/pull/1019
- Comment: https://github.com/ironcore-dev/metal-operator/pull/1019#issuecomment (requested by `@afritzler`)
- Related issue: `#1018`

Requested by: `@afritzler`"

Length of output: 1929


@afritzler I've created the issue: #1022

It captures the rationale (preventing GC from cascading-deleting BMC and dependent resources when an Endpoint is deleted), affected areas, and acceptance criteria, with backlinks to this PR and issue #1018. Let me know if you'd like any adjustments to the scope or assignee.

@afritzler

Copy link
Copy Markdown
Member Author

@coderabbitai create an issue to remove the Endpoint resource/Ref in BMC and all related controller, webhook and unit tests.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
gh issue create \
  --repo ironcore-dev/metal-operator \
  --title "Remove Endpoint resource/Ref from BMC and related controller, webhook, and unit tests" \
  --assignee afritzler \
  --body "## Summary
Fully remove the \`Endpoint\` resource and its reference (\`endpointRef\`) from \`BMC\`, along with all related controller logic, webhook logic, and unit tests.

## Rationale
The \`Endpoint\` resource was deprecated in PR \`#1019\` (issue \`#1018\`) in favor of modeling endpoint information inline via \`BMC.spec.access\` (an \`InlineEndpoint\` carrying MAC address and IP). Now that the deprecation notice is in place, the next step is to complete the removal of the \`Endpoint\` type, its API, controller, webhook, and the \`endpointRef\` field/usage in \`BMC\`, along with associated unit tests, once consumers have migrated.

## Affected areas
- \`api/v1alpha1/endpoint_types.go\` and its generated apply configuration (\`api/v1alpha1/applyconfiguration/api/v1alpha1/endpoint.go\`)
- \`config/crd/bases/metal.ironcore.dev_endpoints.yaml\`
- \`internal/webhook/v1alpha1/endpoint_webhook.go\` and its unit tests
- Controllers referencing \`Endpoint\`/\`endpointRef\` in \`BMC\` reconciliation (likely under \`internal/controller\`)
- Any RBAC, sample manifests, and generated client code referencing \`Endpoint\`
- Documentation: \`docs/concepts/endpoints.md\`, \`docs/api-reference/api.md\`
- \`.golangci.yml\` staticcheck exclusion rule for \`Endpoint\` deprecation warnings (\`SA1019.*metalv1alpha1\.Endpoint\`), which should be removed once the type itself is removed

## Acceptance criteria
- The \`Endpoint\` CRD, its Go types, generated clients/apply configurations, and webhook are removed from the codebase.
- The \`endpointRef\`/reference to \`Endpoint\` is removed from the \`BMC\` spec/status and its controller logic.
- All related unit tests are removed or updated accordingly.
- Documentation is updated to remove references to the standalone \`Endpoint\` resource, pointing solely to \`BMC.spec.access\`.
- Related follow-up issue \`#1022\` (removing the \`OwnerReference\` dependency between \`Endpoint\` and \`BMC\`) is considered/closed as part of this cleanup if still applicable.

## References
- PR: https://github.com/ironcore-dev/metal-operator/pull/1019
- Related issue: `#1018`
- Related follow-up issue: `#1022`

Requested by: `@afritzler`"

Length of output: 2595


@afritzler I've created the issue: #1023

It covers removing the Endpoint resource, its endpointRef in BMC, and all related controller, webhook, and unit test code, with backlinks to this PR, issue #1018, and the related follow-up issue #1022.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
internal/webhook/v1alpha1/bmc_webhook.go (1)

18-19: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the unused package-level logger.

Once the webhook validation methods are updated to extract the logger from the context (as required by the coding guidelines), this package-level bmclog variable will be unused and should be removed.

♻️ Proposed refactor
-// log is for logging in this package.
-var bmclog = logf.Log.WithName("bmc-resource")
🤖 Prompt for 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.

In `@internal/webhook/v1alpha1/bmc_webhook.go` around lines 18 - 19, Remove the
unused package-level bmclog logger declaration and any now-unneeded import
supporting it, after webhook validation methods obtain logging from their
context.
🤖 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 `@internal/webhook/v1alpha1/bmc_webhook.go`:
- Around line 47-65: Update ValidateCreate, ValidateUpdate, and ValidateDelete
to obtain the logger from each method’s context via logf.FromContext(ctx)
instead of using the package-level bmclog, and log active-voice messages
beginning with “Validating BMC” while preserving the existing name field and
validation behavior.

---

Nitpick comments:
In `@internal/webhook/v1alpha1/bmc_webhook.go`:
- Around line 18-19: Remove the unused package-level bmclog logger declaration
and any now-unneeded import supporting it, after webhook validation methods
obtain logging from their context.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8417d6e5-785b-4be8-9c55-05a408cb49d7

📥 Commits

Reviewing files that changed from the base of the PR and between bf726ac and c537ad7.

⛔ Files ignored due to path filters (2)
  • dist/chart/templates/crd/metal.ironcore.dev_bmcs.yaml is excluded by !**/dist/**
  • dist/chart/templates/webhook/webhooks.yaml is excluded by !**/dist/**
📒 Files selected for processing (9)
  • .golangci.yml
  • api/v1alpha1/applyconfiguration/api/v1alpha1/bmcspec.go
  • api/v1alpha1/bmc_types.go
  • cmd/main.go
  • config/crd/bases/metal.ironcore.dev_bmcs.yaml
  • config/webhook/manifests.yaml
  • docs/api-reference/api.md
  • internal/webhook/v1alpha1/bmc_webhook.go
  • internal/webhook/v1alpha1/webhook_suite_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • .golangci.yml

Comment thread internal/webhook/v1alpha1/bmc_webhook.go Outdated
@afritzler
afritzler force-pushed the enh/endpoint-deprecation branch 3 times, most recently from 07911bc to ec71469 Compare July 16, 2026 13:54
Signed-off-by: Andreas Fritzler <andreas.fritzler@sap.com>
Signed-off-by: Andreas Fritzler <andreas.fritzler@sap.com>
@afritzler
afritzler force-pushed the enh/endpoint-deprecation branch from ec71469 to 97f01a2 Compare July 16, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-change deprecation documentation Improvements or additions to documentation enhancement New feature or request

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Deprecate the Endpoint Resource

1 participant