diff --git a/README.md b/README.md index 9b0292c..426af52 100644 --- a/README.md +++ b/README.md @@ -68,14 +68,14 @@ $ oc get nodepools.hardwaremanagement.oran.openshift.io -n oran-hwmgr-plugin-tes apiVersion: hardwaremanagement.oran.openshift.io/v1alpha1 kind: NodePool metadata: - creationTimestamp: "2024-09-05T12:50:47Z" + creationTimestamp: "2024-09-18T17:29:00Z" finalizers: - oran-hwmgr-plugin-test.oran.openshift.io/nodepool-finalizer generation: 1 name: np1 namespace: oran-hwmgr-plugin-test - resourceVersion: "16208137" - uid: 5486b5e7-415b-4f63-a443-8cd88a32fef6 + resourceVersion: "15851" + uid: 00be582c-3026-4421-bb92-b394415cff6b spec: cloudID: testcloud-1 location: ottawa @@ -89,7 +89,7 @@ spec: site: building-1 status: conditions: - - lastTransitionTime: "2024-09-05T12:51:08Z" + - lastTransitionTime: "2024-09-18T17:29:21Z" message: Created reason: Completed status: "True" @@ -102,12 +102,12 @@ $ oc get nodes.hardwaremanagement.oran.openshift.io -n oran-hwmgr-plugin-test du apiVersion: hardwaremanagement.oran.openshift.io/v1alpha1 kind: Node metadata: - creationTimestamp: "2024-09-05T12:50:58Z" + creationTimestamp: "2024-09-18T17:29:11Z" generation: 1 name: dummy-sp-64g-1 namespace: oran-hwmgr-plugin-test - resourceVersion: "16208107" - uid: 0838467c-f73e-4c5b-86cf-0083352243ce + resourceVersion: "15831" + uid: a0021f5a-34bc-4e5f-95c4-8372f4ce3fa3 spec: groupName: master hwProfile: profile-spr-single-processor-64G @@ -115,15 +115,18 @@ spec: status: bmc: address: idrac-virtualmedia+https://192.168.2.1/redfish/v1/Systems/System.Embedded.1 - credentialsName: bmcSecret-dummy-sp-64g-1 - bootMACAddress: c6:b6:13:a0:02:01 + credentialsName: dummy-sp-64g-1-bmc-secret conditions: - - lastTransitionTime: "2024-09-05T12:50:58Z" + - lastTransitionTime: "2024-09-18T17:29:11Z" message: Provisioned reason: Completed status: "True" type: Provisioned hostname: dummy-sp-64g-1.localhost + interfaces: + - label: bootable-interface + macAddress: c6:b6:13:a0:02:01 + name: eth0 $ oc get configmap -n oran-hwmgr-plugin-test nodelist -o yaml apiVersion: v1 @@ -143,65 +146,97 @@ data: hwprofile: profile-spr-dual-processor-128G bmc: address: "idrac-virtualmedia+https://192.168.1.0/redfish/v1/Systems/System.Embedded.1" - credentialsName: "bmcSecret-dummy-dp-128g-0" - bootMACAddress: "c6:b6:13:a0:01:00" + username-base64: YWRtaW4= + password-base64: bXlwYXNz + interfaces: + - name: eth0 + label: bootable-interface + macAddress: "c6:b6:13:a0:01:00" hostname: "dummy-dp-128g-0.localhost" dummy-dp-128g-1: hwprofile: profile-spr-dual-processor-128G bmc: address: "idrac-virtualmedia+https://192.168.1.1/redfish/v1/Systems/System.Embedded.1" - credentialsName: "bmcSecret-dummy-dp-128g-1" - bootMACAddress: "c6:b6:13:a0:01:01" + username-base64: YWRtaW4= + password-base64: bXlwYXNz + interfaces: + - name: eth0 + label: bootable-interface + macAddress: "c6:b6:13:a0:01:01" hostname: "dummy-dp-128g-1.localhost" dummy-dp-128g-2: hwprofile: profile-spr-dual-processor-128G bmc: address: "idrac-virtualmedia+https://192.168.1.2/redfish/v1/Systems/System.Embedded.1" - credentialsName: "bmcSecret-dummy-dp-128g-2" - bootMACAddress: "c6:b6:13:a0:01:02" + username-base64: YWRtaW4= + password-base64: bXlwYXNz + interfaces: + - name: eth0 + label: bootable-interface + macAddress: "c6:b6:13:a0:01:02" hostname: "dummy-dp-128g-2.localhost" dummy-sp-64g-0: hwprofile: profile-spr-single-processor-64G bmc: address: "idrac-virtualmedia+https://192.168.2.0/redfish/v1/Systems/System.Embedded.1" - credentialsName: "bmcSecret-dummy-sp-64g-0" - bootMACAddress: "c6:b6:13:a0:02:00" + username-base64: YWRtaW4= + password-base64: bXlwYXNz + interfaces: + - name: eth0 + label: bootable-interface + macAddress: "c6:b6:13:a0:02:00" hostname: "dummy-sp-64g-0.localhost" dummy-sp-64g-1: hwprofile: profile-spr-single-processor-64G bmc: address: "idrac-virtualmedia+https://192.168.2.1/redfish/v1/Systems/System.Embedded.1" - credentialsName: "bmcSecret-dummy-sp-64g-1" - bootMACAddress: "c6:b6:13:a0:02:01" + username-base64: YWRtaW4= + password-base64: bXlwYXNz + interfaces: + - name: eth0 + label: bootable-interface + macAddress: "c6:b6:13:a0:02:01" hostname: "dummy-sp-64g-1.localhost" dummy-sp-64g-2: hwprofile: profile-spr-single-processor-64G bmc: address: "idrac-virtualmedia+https://192.168.2.2/redfish/v1/Systems/System.Embedded.1" - credentialsName: "bmcSecret-dummy-sp-64g-2" - bootMACAddress: "c6:b6:13:a0:02:02" + username-base64: YWRtaW4= + password-base64: bXlwYXNz + interfaces: + - name: eth0 + label: bootable-interface + macAddress: "c6:b6:13:a0:02:02" hostname: "dummy-sp-64g-2.localhost" dummy-sp-64g-3: hwprofile: profile-spr-single-processor-64G bmc: address: "idrac-virtualmedia+https://192.168.2.3/redfish/v1/Systems/System.Embedded.1" - credentialsName: "bmcSecret-dummy-sp-64g-3" - bootMACAddress: "c6:b6:13:a0:02:03" + username-base64: YWRtaW4= + password-base64: bXlwYXNz + interfaces: + - name: eth0 + label: bootable-interface + macAddress: "c6:b6:13:a0:02:03" hostname: "dummy-sp-64g-3.localhost" dummy-sp-64g-4: hwprofile: profile-spr-single-processor-64G bmc: address: "idrac-virtualmedia+https://192.168.2.4/redfish/v1/Systems/System.Embedded.1" - credentialsName: "bmcSecret-dummy-sp-64g-4" - bootMACAddress: "c6:b6:13:a0:02:04" + username-base64: YWRtaW4= + password-base64: bXlwYXNz + interfaces: + - name: eth0 + label: bootable-interface + macAddress: "c6:b6:13:a0:02:04" hostname: "dummy-sp-64g-4.localhost" kind: ConfigMap metadata: - creationTimestamp: "2024-09-05T12:47:59Z" + creationTimestamp: "2024-09-18T17:28:38Z" name: nodelist namespace: oran-hwmgr-plugin-test - resourceVersion: "16208103" - uid: f0cc6238-15a1-40fd-abf1-4dcd0e32a531 + resourceVersion: "15829" + uid: e6dfe91c-0713-46d2-b3e5-b883c3d8b8c5 ``` diff --git a/configmap/example-nodelist.yaml b/configmap/example-nodelist.yaml index 5e710cb..bbaebd2 100644 --- a/configmap/example-nodelist.yaml +++ b/configmap/example-nodelist.yaml @@ -15,7 +15,10 @@ data: address: "idrac-virtualmedia+https://192.168.1.0/redfish/v1/Systems/System.Embedded.1" username-base64: YWRtaW4= password-base64: bXlwYXNz - bootMACAddress: "c6:b6:13:a0:01:00" + interfaces: + - name: eth0 + label: bootable-interface + macAddress: "c6:b6:13:a0:01:00" hostname: "dummy-dp-128g-0.localhost" dummy-dp-128g-1: hwprofile: profile-spr-dual-processor-128G @@ -23,7 +26,10 @@ data: address: "idrac-virtualmedia+https://192.168.1.1/redfish/v1/Systems/System.Embedded.1" username-base64: YWRtaW4= password-base64: bXlwYXNz - bootMACAddress: "c6:b6:13:a0:01:01" + interfaces: + - name: eth0 + label: bootable-interface + macAddress: "c6:b6:13:a0:01:01" hostname: "dummy-dp-128g-1.localhost" dummy-dp-128g-2: hwprofile: profile-spr-dual-processor-128G @@ -31,7 +37,10 @@ data: address: "idrac-virtualmedia+https://192.168.1.2/redfish/v1/Systems/System.Embedded.1" username-base64: YWRtaW4= password-base64: bXlwYXNz - bootMACAddress: "c6:b6:13:a0:01:02" + interfaces: + - name: eth0 + label: bootable-interface + macAddress: "c6:b6:13:a0:01:02" hostname: "dummy-dp-128g-2.localhost" dummy-sp-64g-0: hwprofile: profile-spr-single-processor-64G @@ -39,7 +48,10 @@ data: address: "idrac-virtualmedia+https://192.168.2.0/redfish/v1/Systems/System.Embedded.1" username-base64: YWRtaW4= password-base64: bXlwYXNz - bootMACAddress: "c6:b6:13:a0:02:00" + interfaces: + - name: eth0 + label: bootable-interface + macAddress: "c6:b6:13:a0:02:00" hostname: "dummy-sp-64g-0.localhost" dummy-sp-64g-1: hwprofile: profile-spr-single-processor-64G @@ -47,7 +59,10 @@ data: address: "idrac-virtualmedia+https://192.168.2.1/redfish/v1/Systems/System.Embedded.1" username-base64: YWRtaW4= password-base64: bXlwYXNz - bootMACAddress: "c6:b6:13:a0:02:01" + interfaces: + - name: eth0 + label: bootable-interface + macAddress: "c6:b6:13:a0:02:01" hostname: "dummy-sp-64g-1.localhost" dummy-sp-64g-2: hwprofile: profile-spr-single-processor-64G @@ -55,7 +70,10 @@ data: address: "idrac-virtualmedia+https://192.168.2.2/redfish/v1/Systems/System.Embedded.1" username-base64: YWRtaW4= password-base64: bXlwYXNz - bootMACAddress: "c6:b6:13:a0:02:02" + interfaces: + - name: eth0 + label: bootable-interface + macAddress: "c6:b6:13:a0:02:02" hostname: "dummy-sp-64g-2.localhost" dummy-sp-64g-3: hwprofile: profile-spr-single-processor-64G @@ -63,7 +81,10 @@ data: address: "idrac-virtualmedia+https://192.168.2.3/redfish/v1/Systems/System.Embedded.1" username-base64: YWRtaW4= password-base64: bXlwYXNz - bootMACAddress: "c6:b6:13:a0:02:03" + interfaces: + - name: eth0 + label: bootable-interface + macAddress: "c6:b6:13:a0:02:03" hostname: "dummy-sp-64g-3.localhost" dummy-sp-64g-4: hwprofile: profile-spr-single-processor-64G @@ -71,5 +92,8 @@ data: address: "idrac-virtualmedia+https://192.168.2.4/redfish/v1/Systems/System.Embedded.1" username-base64: YWRtaW4= password-base64: bXlwYXNz - bootMACAddress: "c6:b6:13:a0:02:04" + interfaces: + - name: eth0 + label: bootable-interface + macAddress: "c6:b6:13:a0:02:04" hostname: "dummy-sp-64g-4.localhost" diff --git a/configmap/generator.sh b/configmap/generator.sh index 6439168..fa965ec 100755 --- a/configmap/generator.sh +++ b/configmap/generator.sh @@ -63,19 +63,16 @@ function nodes { address: "idrac-virtualmedia+https://${ip}/redfish/v1/Systems/System.Embedded.1" username-base64: ${USERNAME_BASE64} password-base64: ${PASSWORD_BASE64} - bootMACAddress: "${mac}" + interfaces: + - name: eth0 + label: bootable-interface + macAddress: "${mac}" hostname: "${nodename}.localhost" EOF done done } -# bmc: | -# { -# "address": "idrac-virtualmedia+https://${ip}/redfish/v1/Systems/System.Embedded.1", -# "credentialsName": "bmcSecret-${nodename}" -# } - # # Process cmdline arguments # diff --git a/go.mod b/go.mod index b92a20d..d3f3780 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ toolchain go1.22.5 require ( github.com/onsi/ginkgo/v2 v2.11.0 github.com/onsi/gomega v1.27.10 - github.com/openshift-kni/oran-o2ims/api/hardwaremanagement v0.0.0-20240903165820-cebcd5f0272a + github.com/openshift-kni/oran-o2ims/api/hardwaremanagement v0.0.0-20240918174245-ac8a45e122a5 k8s.io/api v0.28.3 k8s.io/apimachinery v0.28.4 k8s.io/client-go v0.28.3 diff --git a/go.sum b/go.sum index eb31a2e..e8fe6c3 100644 --- a/go.sum +++ b/go.sum @@ -88,8 +88,8 @@ github.com/onsi/ginkgo/v2 v2.11.0 h1:WgqUCUt/lT6yXoQ8Wef0fsNn5cAuMK7+KT9UFRz2tcU github.com/onsi/ginkgo/v2 v2.11.0/go.mod h1:ZhrRA5XmEE3x3rhlzamx/JJvujdZoJ2uvgI7kR0iZvM= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= -github.com/openshift-kni/oran-o2ims/api/hardwaremanagement v0.0.0-20240903165820-cebcd5f0272a h1:ntdRx64DfNZkTriFIwXDoWMHiu/i5AvP/ekaJEQ3I24= -github.com/openshift-kni/oran-o2ims/api/hardwaremanagement v0.0.0-20240903165820-cebcd5f0272a/go.mod h1:owBMlvtNeWmBGKEdusRCmtIxdxBIFinYlCpaVRfYSoo= +github.com/openshift-kni/oran-o2ims/api/hardwaremanagement v0.0.0-20240918174245-ac8a45e122a5 h1:gff7gL/cgi8CVQGYKCxac56vki4NUZzRV6Eov65RP58= +github.com/openshift-kni/oran-o2ims/api/hardwaremanagement v0.0.0-20240918174245-ac8a45e122a5/go.mod h1:owBMlvtNeWmBGKEdusRCmtIxdxBIFinYlCpaVRfYSoo= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= diff --git a/internal/service/hwmgr.go b/internal/service/hwmgr.go index 693672d..b7f895f 100644 --- a/internal/service/hwmgr.go +++ b/internal/service/hwmgr.go @@ -27,10 +27,10 @@ type cmBmcInfo struct { } type cmNodeInfo struct { - HwProfile string `json:"hwprofile" yaml:"hwprofile"` - BMC *cmBmcInfo `json:"bmc,omitempty"` - BootMACAddress string `json:"bootMACAddress,omitempty"` - Hostname string `json:"hostname,omitempty"` + HwProfile string `json:"hwprofile" yaml:"hwprofile"` + BMC *cmBmcInfo `json:"bmc,omitempty"` + Interfaces []*hwmgmtv1alpha1.Interface `json:"interfaces,omitempty"` + Hostname string `json:"hostname,omitempty"` } type cmResources struct { @@ -351,8 +351,8 @@ func (h *HwMgrService) UpdateNodeStatus(ctx context.Context, nodename string, in Address: info.BMC.Address, CredentialsName: bmcSecretName(nodename), } - node.Status.BootMACAddress = info.BootMACAddress node.Status.Hostname = info.Hostname + node.Status.Interfaces = info.Interfaces utils.SetStatusCondition(&node.Status.Conditions, hwmgmtv1alpha1.Provisioned, diff --git a/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/groupversion.go b/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/groupversion.go index 06b57ca..4cf5298 100644 --- a/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/groupversion.go +++ b/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/groupversion.go @@ -15,7 +15,7 @@ License. // Package v1alpha1 contains API schema definitions for the O2 IMS hardware manager plugin API. // // +kubebuilder:object:generate=true -// +groupName=hardwaremanagement.oran.openshift.io +// +groupName=o2ims-hardwaremanagement.oran.openshift.io package v1alpha1 import ( @@ -25,7 +25,7 @@ import ( var ( // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "hardwaremanagement.oran.openshift.io", Version: "v1alpha1"} + GroupVersion = schema.GroupVersion{Group: "o2ims-hardwaremanagement.oran.openshift.io", Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} diff --git a/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/node.go b/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/node.go index 6ea0db0..6c76663 100644 --- a/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/node.go +++ b/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/node.go @@ -18,10 +18,23 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +type Interface struct { + Name string `json:"name"` // The name of the network interface (e.g., eth0, ens33) + Label string `json:"label"` // The label of the interface + // +kubebuilder:validation:Pattern=`^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$` + MACAddress string `json:"macAddress"` // The MAC address of the interface +} + // NodeSpec describes a node presents a hardware server type NodeSpec struct { - NodePool string `json:"nodePool"` + // NodePool + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Node Pool",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} + NodePool string `json:"nodePool"` + // GroupName + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Group Name",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} GroupName string `json:"groupName"` + // HwProfile + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Hardware Profile",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} HwProfile string `json:"hwProfile"` } @@ -39,7 +52,7 @@ type BMC struct { type NodeStatus struct { BMC *BMC `json:"bmc,omitempty"` - BootMACAddress string `json:"bootMACAddress,omitempty"` + Interfaces []*Interface `json:"interfaces,omitempty"` Hostname string `json:"hostname,omitempty"` @@ -52,6 +65,7 @@ type NodeStatus struct { // // +kubebuilder:object:root=true // +kubebuilder:subresource:status +// +operator-sdk:csv:customresourcedefinitions:displayName="ORAN O2IMS Cluster Request",resources={{Namespace, v1}} type Node struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/node_allocation_request.go b/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/node_allocation_request.go deleted file mode 100644 index a0f2c46..0000000 --- a/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/node_allocation_request.go +++ /dev/null @@ -1,132 +0,0 @@ -/* -Copyright (c) 2024 Red Hat, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is -distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -implied. See the License for the specific language governing permissions and limitations under the -License. -*/ - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// NodeAllocationRequestSpec describes a request to allocate and prepare a node that will -// eventually be part of a deployment manager. -type NodeAllocationRequestSpec struct { - // CloudID is the identifier of the O-Cloud that generated this request. The hardware - // manager may want to use this to tag the nodes in its database, and to generate - // statistics. - // - // +kubebuilder:validation:Required - CloudID string `json:"cloudID"` - - // Location is the geographical location of the requested node. - // - // +kubebuilder:validation:Required - Location string `json:"location"` - - // Extensions contains additional information that is associated to the request. - // - // This will be populated from the extensions that are defined in the top level of the - // deployment manager template, in the node profile, and in the node set. For example, - // if the deployment manager template contains this: - // - // extensions: - // "oran.openshift.io/release": "4.16.1" - // "oran.acme.com/cores": "16" - // nodeProfiles: - // - name: high-performance - // extensions: - // "oran.acme.com/cores": "32" - // "oran.acme.com/memory": "128GiB" - // nodeSets: - // - name: control-plane - // size: 3 - // profile: high-performance - // extensions: - // "oran.acme.com/memory": "256GiB" - // - // Then three node orders will be generated, and each will contain the following: - // - // extensions: - // "oran.acme.com/cores": "32" - // "oran.acme.com/memory": "256GiB" - // - // Note how the extensions not related to the hardware like `oran.openshift.io/release` - // aren't copied to the request, and how the `oran.acme.com/memory` extension in the node - // set overrides the same extesions from the node profile. - // - // +kubebuilder:validation:Optional - Extensions map[string]string `json:"extensions,omitempty"` -} - -// NodeAllocationRequestStatus describes the observed state of a request to allocate and prepare -// a node that will eventually be part of a deployment manager. -type NodeAllocationRequestStatus struct { - // NodeID is the identifier of the node used by the hardware manager. This will be used - // by the IMS implementation to reference the node later when it needs to be updated or - // decomissioned. - NodeID string `json:"nodeID,omitempty"` - - // BMC contains the details to connect to the baseboard managment controller - // of the node. - BMC BMCDetails `json:"bmc,omitempty"` - - // Conditions represents the observations of the current state of the template. Possible - // values of the condition type are `Fulfilled` and `Failed`. - Conditions []metav1.Condition `json:"conditions,omitempty"` -} - -// BMCDetails contains the details needed to connect to the baseboard management controller of -// a node. -type BMCDetails struct { - // Address contains the URL for accessing the BMC over the network. - Address string `json:"address,omitempty"` - - // CredentiasName is a reference to a secret containing the credentials. That secret - // should contain the keys `username` and `password`. - CredentialsName string `json:"credentialsName,omitempty"` - - // DisableCertificateVerification disables verification of server certificates when using - // HTTPS to connect to the BMC. This is required when the server certificate is - // self-signed, but is insecure because it allows a man-in-the-middle to intercept the - // connection. - DisableCertificateVerification bool `json:"disableCertificateVerification,omitempty"` -} - -// NodeAllocationRequest is the schema for a node allocation request. -// -// +kubebuilder:resource:shortName=nar -// +kubebuilder:object:root=true -// +kubebuilder:subresource:status -type NodeAllocationRequest struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec NodeAllocationRequestSpec `json:"spec,omitempty"` - Status NodeAllocationRequestStatus `json:"status,omitempty"` -} - -// NodeAllocationRequestList contains a list of node allocation requests. -// -// +kubebuilder:object:root=true -type NodeAllocationRequestList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NodeAllocationRequest `json:"items"` -} - -func init() { - SchemeBuilder.Register( - &NodeAllocationRequest{}, - &NodeAllocationRequestList{}, - ) -} diff --git a/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/node_pools.go b/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/node_pools.go index 645499c..bda5185 100644 --- a/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/node_pools.go +++ b/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/node_pools.go @@ -18,9 +18,14 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) +// LocationSpec is the geographical location of the requested node. type LocationSpec struct { + // Location + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Location",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} Location string `json:"location,omitempty"` - Site string `json:"site"` + // Site + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Site",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} + Site string `json:"site"` } // NodePoolSpec describes a pool of nodes to allocate @@ -30,9 +35,11 @@ type NodePoolSpec struct { // statistics. // // +kubebuilder:validation:Required + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Cloud ID",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} CloudID string `json:"cloudID"` // LocationSpec is the geographical location of the requested node. + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Location Spec",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} LocationSpec `json:",inline"` NodeGroup []NodeGroup `json:"nodeGroup"` @@ -42,6 +49,8 @@ type NodeGroup struct { Name string `json:"name" yaml:"name"` HwProfile string `json:"hwProfile"` Size int `json:"size" yaml:"size"` + // +kubebuilder:validation:MinItems=1 + Interfaces []string `json:"interfaces,omitempty"` } type Properties struct { @@ -64,6 +73,7 @@ type NodePoolStatus struct { // +kubebuilder:resource:shortName=np // +kubebuilder:object:root=true // +kubebuilder:subresource:status +// +operator-sdk:csv:customresourcedefinitions:displayName="ORAN O2IMS Cluster Request",resources={{Namespace, v1}} type NodePool struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/node_release_request.go b/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/node_release_request.go deleted file mode 100644 index 3ceb1b8..0000000 --- a/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/node_release_request.go +++ /dev/null @@ -1,76 +0,0 @@ -/* -Copyright (c) 2024 Red Hat, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in -compliance with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed under the License is -distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or -implied. See the License for the specific language governing permissions and limitations under the -License. -*/ - -package v1alpha1 - -import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" -) - -// NodeReleaseRequestSpec specifies how to release a node that has been previously allocated to be -// part of a deployment manager. -type NodeReleaseRequestSpec struct { - // CloudID is the identifier of the O-Cloud that generated this request. The hardware - // manager may want to use this to tag the nodes in its database, and to generate statistics. - // - // +kubebuilder:validation:Required - CloudID string `json:"cloudID"` - - // NodeID is the identifier of the node that was provided by the hardware manager when the - // node was previosly allocated. - // - // +kubebuilder:validation:Required - NodeID string `json:"nodeID"` - - // Extensions contains additional information that is associated to the request. - // - // +kubebuilder:validation:Optional - Extensions map[string]string `json:"extensions,omitempty"` -} - -// NodeReleaseRequestStatus describes the status of the release request. -type NodeReleaseRequestStatus struct { - // Conditions represents the observations of the current state of the request. Possible - // values of the condition type are `Fulfilled` and `Failed`. - Conditions []metav1.Condition `json:"conditions,omitempty"` -} - -// NodeReleaseRequest is the schema for an request to release a node. -// -// +kubebuilder:resource:shortName=ndo -// +kubebuilder:object:root=true -// +kubebuilder:subresource:status -type NodeReleaseRequest struct { - metav1.TypeMeta `json:",inline"` - metav1.ObjectMeta `json:"metadata,omitempty"` - - Spec NodeReleaseRequestSpec `json:"spec,omitempty"` - Status NodeReleaseRequestStatus `json:"status,omitempty"` -} - -// NodeReleaseRequestList contains a list of node release requests. -// -// +kubebuilder:object:root=true -type NodeReleaseRequestList struct { - metav1.TypeMeta `json:",inline"` - metav1.ListMeta `json:"metadata,omitempty"` - Items []NodeReleaseRequest `json:"items"` -} - -func init() { - SchemeBuilder.Register( - &NodeReleaseRequest{}, - &NodeReleaseRequestList{}, - ) -} diff --git a/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/zz_generated.deepcopy.go index 6bb9fe4..fa3ee99 100644 --- a/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/zz_generated.deepcopy.go @@ -41,16 +41,16 @@ func (in *BMC) DeepCopy() *BMC { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *BMCDetails) DeepCopyInto(out *BMCDetails) { +func (in *Interface) DeepCopyInto(out *Interface) { *out = *in } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BMCDetails. -func (in *BMCDetails) DeepCopy() *BMCDetails { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Interface. +func (in *Interface) DeepCopy() *Interface { if in == nil { return nil } - out := new(BMCDetails) + out := new(Interface) in.DeepCopyInto(out) return out } @@ -97,113 +97,14 @@ func (in *Node) DeepCopyObject() runtime.Object { return nil } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeAllocationRequest) DeepCopyInto(out *NodeAllocationRequest) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocationRequest. -func (in *NodeAllocationRequest) DeepCopy() *NodeAllocationRequest { - if in == nil { - return nil - } - out := new(NodeAllocationRequest) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NodeAllocationRequest) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeAllocationRequestList) DeepCopyInto(out *NodeAllocationRequestList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NodeAllocationRequest, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocationRequestList. -func (in *NodeAllocationRequestList) DeepCopy() *NodeAllocationRequestList { - if in == nil { - return nil - } - out := new(NodeAllocationRequestList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NodeAllocationRequestList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeAllocationRequestSpec) DeepCopyInto(out *NodeAllocationRequestSpec) { - *out = *in - if in.Extensions != nil { - in, out := &in.Extensions, &out.Extensions - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocationRequestSpec. -func (in *NodeAllocationRequestSpec) DeepCopy() *NodeAllocationRequestSpec { - if in == nil { - return nil - } - out := new(NodeAllocationRequestSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeAllocationRequestStatus) DeepCopyInto(out *NodeAllocationRequestStatus) { - *out = *in - out.BMC = in.BMC - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]v1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeAllocationRequestStatus. -func (in *NodeAllocationRequestStatus) DeepCopy() *NodeAllocationRequestStatus { - if in == nil { - return nil - } - out := new(NodeAllocationRequestStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeGroup) DeepCopyInto(out *NodeGroup) { *out = *in + if in.Interfaces != nil { + in, out := &in.Interfaces, &out.Interfaces + *out = make([]string, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeGroup. @@ -314,7 +215,9 @@ func (in *NodePoolSpec) DeepCopyInto(out *NodePoolSpec) { if in.NodeGroup != nil { in, out := &in.NodeGroup, &out.NodeGroup *out = make([]NodeGroup, len(*in)) - copy(*out, *in) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } } } @@ -351,109 +254,6 @@ func (in *NodePoolStatus) DeepCopy() *NodePoolStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeReleaseRequest) DeepCopyInto(out *NodeReleaseRequest) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) - in.Spec.DeepCopyInto(&out.Spec) - in.Status.DeepCopyInto(&out.Status) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeReleaseRequest. -func (in *NodeReleaseRequest) DeepCopy() *NodeReleaseRequest { - if in == nil { - return nil - } - out := new(NodeReleaseRequest) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NodeReleaseRequest) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeReleaseRequestList) DeepCopyInto(out *NodeReleaseRequestList) { - *out = *in - out.TypeMeta = in.TypeMeta - in.ListMeta.DeepCopyInto(&out.ListMeta) - if in.Items != nil { - in, out := &in.Items, &out.Items - *out = make([]NodeReleaseRequest, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeReleaseRequestList. -func (in *NodeReleaseRequestList) DeepCopy() *NodeReleaseRequestList { - if in == nil { - return nil - } - out := new(NodeReleaseRequestList) - in.DeepCopyInto(out) - return out -} - -// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *NodeReleaseRequestList) DeepCopyObject() runtime.Object { - if c := in.DeepCopy(); c != nil { - return c - } - return nil -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeReleaseRequestSpec) DeepCopyInto(out *NodeReleaseRequestSpec) { - *out = *in - if in.Extensions != nil { - in, out := &in.Extensions, &out.Extensions - *out = make(map[string]string, len(*in)) - for key, val := range *in { - (*out)[key] = val - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeReleaseRequestSpec. -func (in *NodeReleaseRequestSpec) DeepCopy() *NodeReleaseRequestSpec { - if in == nil { - return nil - } - out := new(NodeReleaseRequestSpec) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodeReleaseRequestStatus) DeepCopyInto(out *NodeReleaseRequestStatus) { - *out = *in - if in.Conditions != nil { - in, out := &in.Conditions, &out.Conditions - *out = make([]v1.Condition, len(*in)) - for i := range *in { - (*in)[i].DeepCopyInto(&(*out)[i]) - } - } -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeReleaseRequestStatus. -func (in *NodeReleaseRequestStatus) DeepCopy() *NodeReleaseRequestStatus { - if in == nil { - return nil - } - out := new(NodeReleaseRequestStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *NodeSpec) DeepCopyInto(out *NodeSpec) { *out = *in @@ -477,6 +277,17 @@ func (in *NodeStatus) DeepCopyInto(out *NodeStatus) { *out = new(BMC) **out = **in } + if in.Interfaces != nil { + in, out := &in.Interfaces, &out.Interfaces + *out = make([]*Interface, len(*in)) + for i := range *in { + if (*in)[i] != nil { + in, out := &(*in)[i], &(*out)[i] + *out = new(Interface) + **out = **in + } + } + } if in.Conditions != nil { in, out := &in.Conditions, &out.Conditions *out = make([]v1.Condition, len(*in)) diff --git a/vendor/modules.txt b/vendor/modules.txt index 4adbcc3..ab0ec28 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -135,7 +135,7 @@ github.com/onsi/gomega/matchers/support/goraph/edge github.com/onsi/gomega/matchers/support/goraph/node github.com/onsi/gomega/matchers/support/goraph/util github.com/onsi/gomega/types -# github.com/openshift-kni/oran-o2ims/api/hardwaremanagement v0.0.0-20240903165820-cebcd5f0272a +# github.com/openshift-kni/oran-o2ims/api/hardwaremanagement v0.0.0-20240918174245-ac8a45e122a5 ## explicit; go 1.21 github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1 # github.com/pkg/errors v0.9.1