From 12f2967a85bacc76ddbc41300f1c5bf2f61437d1 Mon Sep 17 00:00:00 2001 From: Andreas Fritzler Date: Wed, 15 Jul 2026 17:09:10 +0200 Subject: [PATCH 1/2] Deprecate the Endpoint resource Signed-off-by: Andreas Fritzler --- .golangci.yml | 6 ++++++ api/v1alpha1/applyconfiguration/api/v1alpha1/endpoint.go | 6 +++++- api/v1alpha1/endpoint_types.go | 4 ++++ config/crd/bases/metal.ironcore.dev_endpoints.yaml | 7 ++++++- .../chart/templates/crd/metal.ironcore.dev_endpoints.yaml | 7 ++++++- docs/api-reference/api.md | 4 ++++ docs/concepts/endpoints.md | 5 +++++ docs/concepts/servermaintenance.md | 2 +- docs/concepts/servers.md | 2 +- docs/usage/metalctl.md | 2 +- internal/webhook/v1alpha1/endpoint_webhook.go | 8 ++++++-- 11 files changed, 45 insertions(+), 8 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index d70db8433..c89452aaf 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -50,6 +50,12 @@ linters: - lll - goconst path: bmc/* + # The Endpoint resource is deprecated (see issue #1018). The operator still + # serves existing Endpoint objects and the endpointRef access path, so these + # legacy consumers reference the type until the resource is fully removed. + - linters: + - staticcheck + text: "SA1019.*metalv1alpha1\\.Endpoint" paths: - third_party$ - builtin$ diff --git a/api/v1alpha1/applyconfiguration/api/v1alpha1/endpoint.go b/api/v1alpha1/applyconfiguration/api/v1alpha1/endpoint.go index 6b6105d85..3dd449379 100644 --- a/api/v1alpha1/applyconfiguration/api/v1alpha1/endpoint.go +++ b/api/v1alpha1/applyconfiguration/api/v1alpha1/endpoint.go @@ -17,7 +17,11 @@ import ( // EndpointApplyConfiguration represents a declarative configuration of the Endpoint type for use // with apply. // -// Endpoint is the Schema for the endpoints API +// # Endpoint is the Schema for the endpoints API +// +// Deprecated: The Endpoint resource is deprecated. Model the same information +// inline via BMC.spec.access (an InlineEndpoint carrying the MAC address and IP) +// instead of creating a separate Endpoint object. type EndpointApplyConfiguration struct { v1.TypeMetaApplyConfiguration `json:",inline"` *v1.ObjectMetaApplyConfiguration `json:"metadata,omitempty"` diff --git a/api/v1alpha1/endpoint_types.go b/api/v1alpha1/endpoint_types.go index 54994e0b2..641c76abf 100644 --- a/api/v1alpha1/endpoint_types.go +++ b/api/v1alpha1/endpoint_types.go @@ -33,6 +33,10 @@ type EndpointStatus struct { // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` // Endpoint is the Schema for the endpoints API +// +// Deprecated: The Endpoint resource is deprecated. Model the same information +// inline via BMC.spec.access (an InlineEndpoint carrying the MAC address and IP) +// instead of creating a separate Endpoint object. type Endpoint struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/config/crd/bases/metal.ironcore.dev_endpoints.yaml b/config/crd/bases/metal.ironcore.dev_endpoints.yaml index 3587fc864..f9a5f5d59 100644 --- a/config/crd/bases/metal.ironcore.dev_endpoints.yaml +++ b/config/crd/bases/metal.ironcore.dev_endpoints.yaml @@ -29,7 +29,12 @@ spec: name: v1alpha1 schema: openAPIV3Schema: - description: Endpoint is the Schema for the endpoints API + description: |- + Endpoint is the Schema for the endpoints API + + Deprecated: The Endpoint resource is deprecated. Model the same information + inline via BMC.spec.access (an InlineEndpoint carrying the MAC address and IP) + instead of creating a separate Endpoint object. properties: apiVersion: description: |- diff --git a/dist/chart/templates/crd/metal.ironcore.dev_endpoints.yaml b/dist/chart/templates/crd/metal.ironcore.dev_endpoints.yaml index 664b7fcd0..76f48c1e1 100755 --- a/dist/chart/templates/crd/metal.ironcore.dev_endpoints.yaml +++ b/dist/chart/templates/crd/metal.ironcore.dev_endpoints.yaml @@ -35,7 +35,12 @@ spec: name: v1alpha1 schema: openAPIV3Schema: - description: Endpoint is the Schema for the endpoints API + description: |- + Endpoint is the Schema for the endpoints API + + Deprecated: The Endpoint resource is deprecated. Model the same information + inline via BMC.spec.access (an InlineEndpoint carrying the MAC address and IP) + instead of creating a separate Endpoint object. properties: apiVersion: description: |- diff --git a/docs/api-reference/api.md b/docs/api-reference/api.md index 0e99c7925..a6004cc5b 100644 --- a/docs/api-reference/api.md +++ b/docs/api-reference/api.md @@ -984,6 +984,10 @@ _Appears in:_ Endpoint is the Schema for the endpoints API +Deprecated: The Endpoint resource is deprecated. Model the same information +inline via BMC.spec.access (an InlineEndpoint carrying the MAC address and IP) +instead of creating a separate Endpoint object. + diff --git a/docs/concepts/endpoints.md b/docs/concepts/endpoints.md index 0bb92ac99..04fccc4d0 100644 --- a/docs/concepts/endpoints.md +++ b/docs/concepts/endpoints.md @@ -1,5 +1,10 @@ # Endpoints +> **Deprecation Notice:** The `Endpoint` resource is deprecated and will be removed in a future release. +> The same information (MAC address and IP) can be modeled inline via +> [`BMC.spec.access`](bmcs.md) (an `InlineEndpoint`) instead of creating a separate `Endpoint` object. +> Creating or updating an `Endpoint` surfaces an admission warning pointing to this replacement. + The Endpoint Custom Resource Definition (CRD) is a Kubernetes resource used to represent and identify devices or entities within an out-of-band (OOB) network. It serves as a means to catalog and manage devices such as Baseboard Management Controllers (BMCs) by capturing their unique identifiers, specifically the MAC address and IP address. diff --git a/docs/concepts/servermaintenance.md b/docs/concepts/servermaintenance.md index a3d7471eb..deffde812 100644 --- a/docs/concepts/servermaintenance.md +++ b/docs/concepts/servermaintenance.md @@ -66,4 +66,4 @@ spec: If `policy: OwnerApproval` and no `ok-to-maintenance` label exists on the `ServerClaim`, this `ServerMaintenance` remains `Pending`, and the `Server` stays as is. Once the label is added (or if the operator setting `alwaysPerformMaintenance` is enabled), the `metal-operator` transitions the `Server` to `Maintenance`, and the -maintenance operator performs the maintenance task. +maintenance operator performs the maintenance task. \ No newline at end of file diff --git a/docs/concepts/servers.md b/docs/concepts/servers.md index ca1810de4..24e69b675 100644 --- a/docs/concepts/servers.md +++ b/docs/concepts/servers.md @@ -169,4 +169,4 @@ spec: address: "192.168.100.10" bmcSecretRef: name: my-bmc-secret -``` +``` \ No newline at end of file diff --git a/docs/usage/metalctl.md b/docs/usage/metalctl.md index b1ebf9e16..3f7571231 100644 --- a/docs/usage/metalctl.md +++ b/docs/usage/metalctl.md @@ -89,4 +89,4 @@ This can now be achieved with the following procedure: #### Dry run With `--dry-run` option you can dry-run the move action by only printing logs without taking any actual actions. Use -`--verbose` flag to enable verbose logging. +`--verbose` flag to enable verbose logging. \ No newline at end of file diff --git a/internal/webhook/v1alpha1/endpoint_webhook.go b/internal/webhook/v1alpha1/endpoint_webhook.go index d2879f9c5..a0bef4901 100644 --- a/internal/webhook/v1alpha1/endpoint_webhook.go +++ b/internal/webhook/v1alpha1/endpoint_webhook.go @@ -42,6 +42,10 @@ type EndpointCustomValidator struct { Client client.Client } +// endpointDeprecationWarning is the admission warning surfaced on Endpoint create/update +// to direct users toward the inlined BMC.spec.access path. +const endpointDeprecationWarning = "Endpoint is deprecated; specify the network access inline via BMC.spec.access (an InlineEndpoint with macAddress and ip) instead" + // ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type Endpoint. func (v *EndpointCustomValidator) ValidateCreate(ctx context.Context, obj *metalv1alpha1.Endpoint) (admission.Warnings, error) { endpointlog.Info("Validation for Endpoint upon creation", "name", obj.GetName()) @@ -54,7 +58,7 @@ func (v *EndpointCustomValidator) ValidateCreate(ctx context.Context, obj *metal obj.GetName(), allErrs) } - return nil, nil + return admission.Warnings{endpointDeprecationWarning}, nil } // ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type Endpoint. @@ -69,7 +73,7 @@ func (v *EndpointCustomValidator) ValidateUpdate(ctx context.Context, oldObj, ne newObj.GetName(), allErrs) } - return nil, nil + return admission.Warnings{endpointDeprecationWarning}, nil } // ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type Endpoint. From 97f01a2e7936f783bf5a33d276cd96488d3e7bd3 Mon Sep 17 00:00:00 2001 From: Andreas Fritzler Date: Thu, 16 Jul 2026 10:57:02 +0200 Subject: [PATCH 2/2] Deprecate the endpointRef field on the BMC resource Signed-off-by: Andreas Fritzler --- .golangci.yml | 6 ++++++ api/v1alpha1/applyconfiguration/api/v1alpha1/bmcspec.go | 4 ++++ api/v1alpha1/bmc_types.go | 4 ++++ api/v1alpha1/endpoint_types.go | 1 + config/crd/bases/metal.ironcore.dev_bmcs.yaml | 8 ++++++-- config/crd/bases/metal.ironcore.dev_endpoints.yaml | 4 ++++ dist/chart/templates/crd/metal.ironcore.dev_bmcs.yaml | 8 ++++++-- .../chart/templates/crd/metal.ironcore.dev_endpoints.yaml | 4 ++++ docs/api-reference/api.md | 2 +- internal/webhook/v1alpha1/endpoint_webhook.go | 8 ++------ 10 files changed, 38 insertions(+), 11 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index c89452aaf..aab0828c1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -56,6 +56,12 @@ linters: - linters: - staticcheck text: "SA1019.*metalv1alpha1\\.Endpoint" + # BMC.spec.endpointRef references the deprecated Endpoint resource. The operator + # still serves existing BMCs that use it, so legacy consumers reference the field + # until the Endpoint resource is fully removed. + - linters: + - staticcheck + text: "SA1019.*\\.EndpointRef is deprecated" paths: - third_party$ - builtin$ diff --git a/api/v1alpha1/applyconfiguration/api/v1alpha1/bmcspec.go b/api/v1alpha1/applyconfiguration/api/v1alpha1/bmcspec.go index 83cdcadc9..e85ed2fde 100644 --- a/api/v1alpha1/applyconfiguration/api/v1alpha1/bmcspec.go +++ b/api/v1alpha1/applyconfiguration/api/v1alpha1/bmcspec.go @@ -17,6 +17,10 @@ type BMCSpecApplyConfiguration struct { // BMCUUID is the unique identifier for the BMC as defined in Redfish API. BMCUUID *string `json:"bmcUUID,omitempty"` // EndpointRef is a reference to the Endpoint object that contains the network access information for the BMC. + // + // Deprecated: The Endpoint resource is deprecated. Specify the network access inline via + // access (an InlineEndpoint carrying the MAC address and IP) instead of referencing an + // Endpoint object. EndpointRef *v1.LocalObjectReference `json:"endpointRef,omitempty"` // Endpoint specifies inline network access details for the BMC. Endpoint *InlineEndpointApplyConfiguration `json:"access,omitempty"` diff --git a/api/v1alpha1/bmc_types.go b/api/v1alpha1/bmc_types.go index 81f74a682..2668a951f 100644 --- a/api/v1alpha1/bmc_types.go +++ b/api/v1alpha1/bmc_types.go @@ -30,6 +30,10 @@ type BMCSpec struct { BMCUUID string `json:"bmcUUID,omitempty"` // EndpointRef is a reference to the Endpoint object that contains the network access information for the BMC. + // + // Deprecated: The Endpoint resource is deprecated. Specify the network access inline via + // access (an InlineEndpoint carrying the MAC address and IP) instead of referencing an + // Endpoint object. // +optional // +kubebuilder:validation:Optional // +kubebuilder:validation:XValidation:rule="self == oldSelf",message="endpointRef is immutable" diff --git a/api/v1alpha1/endpoint_types.go b/api/v1alpha1/endpoint_types.go index 641c76abf..9bf84aaeb 100644 --- a/api/v1alpha1/endpoint_types.go +++ b/api/v1alpha1/endpoint_types.go @@ -31,6 +31,7 @@ type EndpointStatus struct { // +kubebuilder:printcolumn:name="MACAddress",type=string,JSONPath=`.spec.macAddress` // +kubebuilder:printcolumn:name="IP",type=string,JSONPath=`.spec.ip` // +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp` +// +kubebuilder:deprecatedversion:warning="metal.ironcore.dev/v1alpha1 Endpoints are deprecated; specify the network access inline via BMC.spec.access (an InlineEndpoint with macAddress and ip) instead" // Endpoint is the Schema for the endpoints API // diff --git a/config/crd/bases/metal.ironcore.dev_bmcs.yaml b/config/crd/bases/metal.ironcore.dev_bmcs.yaml index c3022281f..3503c3097 100644 --- a/config/crd/bases/metal.ironcore.dev_bmcs.yaml +++ b/config/crd/bases/metal.ironcore.dev_bmcs.yaml @@ -140,8 +140,12 @@ spec: - port type: object endpointRef: - description: EndpointRef is a reference to the Endpoint object that - contains the network access information for the BMC. + description: |- + EndpointRef is a reference to the Endpoint object that contains the network access information for the BMC. + + Deprecated: The Endpoint resource is deprecated. Specify the network access inline via + access (an InlineEndpoint carrying the MAC address and IP) instead of referencing an + Endpoint object. properties: name: default: "" diff --git a/config/crd/bases/metal.ironcore.dev_endpoints.yaml b/config/crd/bases/metal.ironcore.dev_endpoints.yaml index f9a5f5d59..69a194939 100644 --- a/config/crd/bases/metal.ironcore.dev_endpoints.yaml +++ b/config/crd/bases/metal.ironcore.dev_endpoints.yaml @@ -26,6 +26,10 @@ spec: - jsonPath: .metadata.creationTimestamp name: Age type: date + deprecated: true + deprecationWarning: metal.ironcore.dev/v1alpha1 Endpoints are deprecated; specify + the network access inline via BMC.spec.access (an InlineEndpoint with macAddress + and ip) instead name: v1alpha1 schema: openAPIV3Schema: diff --git a/dist/chart/templates/crd/metal.ironcore.dev_bmcs.yaml b/dist/chart/templates/crd/metal.ironcore.dev_bmcs.yaml index 831229924..ec35dba31 100755 --- a/dist/chart/templates/crd/metal.ironcore.dev_bmcs.yaml +++ b/dist/chart/templates/crd/metal.ironcore.dev_bmcs.yaml @@ -146,8 +146,12 @@ spec: - port type: object endpointRef: - description: EndpointRef is a reference to the Endpoint object that - contains the network access information for the BMC. + description: |- + EndpointRef is a reference to the Endpoint object that contains the network access information for the BMC. + + Deprecated: The Endpoint resource is deprecated. Specify the network access inline via + access (an InlineEndpoint carrying the MAC address and IP) instead of referencing an + Endpoint object. properties: name: default: "" diff --git a/dist/chart/templates/crd/metal.ironcore.dev_endpoints.yaml b/dist/chart/templates/crd/metal.ironcore.dev_endpoints.yaml index 76f48c1e1..b2d8dca33 100755 --- a/dist/chart/templates/crd/metal.ironcore.dev_endpoints.yaml +++ b/dist/chart/templates/crd/metal.ironcore.dev_endpoints.yaml @@ -32,6 +32,10 @@ spec: - jsonPath: .metadata.creationTimestamp name: Age type: date + deprecated: true + deprecationWarning: metal.ironcore.dev/v1alpha1 Endpoints are deprecated; specify + the network access inline via BMC.spec.access (an InlineEndpoint with macAddress + and ip) instead name: v1alpha1 schema: openAPIV3Schema: diff --git a/docs/api-reference/api.md b/docs/api-reference/api.md index a6004cc5b..d5c83c960 100644 --- a/docs/api-reference/api.md +++ b/docs/api-reference/api.md @@ -635,7 +635,7 @@ _Appears in:_ | Field | Description | Default | Validation | | --- | --- | --- | --- | | `bmcUUID` _string_ | BMCUUID is the unique identifier for the BMC as defined in Redfish API. | | Optional: \{\}
| -| `endpointRef` _[LocalObjectReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.36/#localobjectreference-v1-core)_ | EndpointRef is a reference to the Endpoint object that contains the network access information for the BMC. | | Optional: \{\}
| +| `endpointRef` _[LocalObjectReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.36/#localobjectreference-v1-core)_ | EndpointRef is a reference to the Endpoint object that contains the network access information for the BMC.
Deprecated: The Endpoint resource is deprecated. Specify the network access inline via
access (an InlineEndpoint carrying the MAC address and IP) instead of referencing an
Endpoint object. | | Optional: \{\}
| | `access` _[InlineEndpoint](#inlineendpoint)_ | Endpoint specifies inline network access details for the BMC. | | Optional: \{\}
| | `bmcSecretRef` _[LocalObjectReference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.36/#localobjectreference-v1-core)_ | BMCSecretRef is a reference to the BMCSecret object that contains the credentials
required to access the BMC. | | | | `protocol` _[Protocol](#protocol)_ | Protocol specifies the protocol to be used for communicating with the BMC. | | | diff --git a/internal/webhook/v1alpha1/endpoint_webhook.go b/internal/webhook/v1alpha1/endpoint_webhook.go index a0bef4901..d2879f9c5 100644 --- a/internal/webhook/v1alpha1/endpoint_webhook.go +++ b/internal/webhook/v1alpha1/endpoint_webhook.go @@ -42,10 +42,6 @@ type EndpointCustomValidator struct { Client client.Client } -// endpointDeprecationWarning is the admission warning surfaced on Endpoint create/update -// to direct users toward the inlined BMC.spec.access path. -const endpointDeprecationWarning = "Endpoint is deprecated; specify the network access inline via BMC.spec.access (an InlineEndpoint with macAddress and ip) instead" - // ValidateCreate implements webhook.CustomValidator so a webhook will be registered for the type Endpoint. func (v *EndpointCustomValidator) ValidateCreate(ctx context.Context, obj *metalv1alpha1.Endpoint) (admission.Warnings, error) { endpointlog.Info("Validation for Endpoint upon creation", "name", obj.GetName()) @@ -58,7 +54,7 @@ func (v *EndpointCustomValidator) ValidateCreate(ctx context.Context, obj *metal obj.GetName(), allErrs) } - return admission.Warnings{endpointDeprecationWarning}, nil + return nil, nil } // ValidateUpdate implements webhook.CustomValidator so a webhook will be registered for the type Endpoint. @@ -73,7 +69,7 @@ func (v *EndpointCustomValidator) ValidateUpdate(ctx context.Context, oldObj, ne newObj.GetName(), allErrs) } - return admission.Warnings{endpointDeprecationWarning}, nil + return nil, nil } // ValidateDelete implements webhook.CustomValidator so a webhook will be registered for the type Endpoint.