diff --git a/Makefile b/Makefile index 4f250a9b..5a88c3bb 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ ginkgo_flags:= # To re-generate a bundle for another specific version without changing the standard setup, you can: # - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2) # - use environment variables to overwrite this value (e.g export VERSION=0.0.2) -VERSION ?= 4.16.0 +VERSION ?= 4.17.0 # DEFAULT_CHANNEL defines the default channel used in the bundle. # Add a new line here if you would like to change its default config. (E.g DEFAULT_CHANNEL = "stable") diff --git a/PROJECT b/PROJECT index 0e5eef22..8c73863c 100644 --- a/PROJECT +++ b/PROJECT @@ -4,7 +4,7 @@ # More info: https://book.kubebuilder.io/reference/project-config.html domain: openshift.io layout: -- go.kubebuilder.io/v3 +- go.kubebuilder.io/v4 multigroup: true projectName: oran-o2ims repo: oran-o2ims @@ -13,27 +13,45 @@ resources: crdVersion: v1 namespaced: true controller: true - domain: openshift.io - group: oran - kind: ORANO2IMS - path: oran-o2ims/api/v1alpha1 + domain: oran.openshift.io + group: o2ims + kind: Inventory + path: github.com/openshift-kni/oran-o2ims/api/v1alpha1 version: v1alpha1 - api: crdVersion: v1 namespaced: true controller: true - domain: openshift.io - group: oran.openshift.io + domain: oran.openshift.io + group: o2ims kind: ClusterTemplate - path: oran-o2ims/api/oran.openshift.io/v1alpha1 + path: github.com/openshift-kni/oran-o2ims/api/v1alpha1 version: v1alpha1 - api: crdVersion: v1 namespaced: true controller: true - domain: openshift.io - group: oran.openshift.io + domain: oran.openshift.io + group: o2ims kind: ClusterRequest - path: oran-o2ims/api/oran.openshift.io/v1alpha1 + path: github.com/openshift-kni/oran-o2ims/api/v1alpha1 + version: v1alpha1 +- api: + crdVersion: v1 + namespaced: true + controller: true + domain: oran.openshift.io + group: o2ims-hardwaremanagement + kind: Node + path: github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1 + version: v1alpha1 +- api: + crdVersion: v1 + namespaced: true + controller: true + domain: oran.openshift.io + group: o2ims-hardwaremanagement + kind: NodePool + path: github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1 version: v1alpha1 version: "3" diff --git a/api/hardwaremanagement/v1alpha1/groupversion.go b/api/hardwaremanagement/v1alpha1/groupversion.go index 06b57cac..4cf5298d 100644 --- a/api/hardwaremanagement/v1alpha1/groupversion.go +++ b/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/api/hardwaremanagement/v1alpha1/node.go b/api/hardwaremanagement/v1alpha1/node.go index 6ea0db09..2de02ceb 100644 --- a/api/hardwaremanagement/v1alpha1/node.go +++ b/api/hardwaremanagement/v1alpha1/node.go @@ -20,8 +20,14 @@ import ( // NodeSpec describes a node presents a hardware server type NodeSpec struct { - NodePool string `json:"nodePool"` + // NodePool + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="NodePool",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} + NodePool string `json:"nodePool"` + // GroupName + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="GroupName",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} GroupName string `json:"groupName"` + // HwProfile + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="HwProfile",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} HwProfile string `json:"hwProfile"` } @@ -52,6 +58,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/api/hardwaremanagement/v1alpha1/node_pools.go b/api/hardwaremanagement/v1alpha1/node_pools.go index 645499c8..e67579e5 100644 --- a/api/hardwaremanagement/v1alpha1/node_pools.go +++ b/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="CloudID",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="LocationSpec",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} LocationSpec `json:",inline"` NodeGroup []NodeGroup `json:"nodeGroup"` @@ -64,6 +71,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/api/v1alpha1/clusterrequest_types.go b/api/v1alpha1/clusterrequest_types.go index 6c530b7d..89bbd2e7 100644 --- a/api/v1alpha1/clusterrequest_types.go +++ b/api/v1alpha1/clusterrequest_types.go @@ -30,14 +30,16 @@ type ClusterRequestSpec struct { // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster // Important: Run "make" to regenerate code after modifying this file - // LocationSpec is the geographical location of the requested node. + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="LocationSpec",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} hwv1alpha1.LocationSpec `json:",inline"` - // ClusterTemplateRef references an existing ClusterTemplate CR. + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="ClusterTemplateRef",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} ClusterTemplateRef string `json:"clusterTemplateRef"` + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="ClusterTemplateInput",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} ClusterTemplateInput ClusterTemplateInput `json:"clusterTemplateInput"` + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Timeout",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} Timeout Timeout `json:"timeout,omitempty"` } @@ -58,6 +60,7 @@ type ClusterTemplateInput struct { PolicyTemplateInput runtime.RawExtension `json:"policyTemplateInput"` } +// NodePoolRef references a node pool. type NodePoolRef struct { // Contains the name of the created NodePool. Name string `json:"name,omitempty"` @@ -121,6 +124,7 @@ type ClusterRequestStatus struct { //+kubebuilder:subresource:status // ClusterRequest is the Schema for the clusterrequests API +// +operator-sdk:csv:customresourcedefinitions:displayName="ORAN O2IMS Cluster Request",resources={{Namespace, v1},{ClusterInstance, siteconfig.open-cluster-management.io/v1alpha1}} type ClusterRequest struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/api/v1alpha1/clustertemplate_types.go b/api/v1alpha1/clustertemplate_types.go index bfacd894..f318d297 100644 --- a/api/v1alpha1/clustertemplate_types.go +++ b/api/v1alpha1/clustertemplate_types.go @@ -29,7 +29,11 @@ type ClusterTemplateSpec struct { // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster // Important: Run "make" to regenerate code after modifying this file - Templates Templates `json:"templates"` + // Templates defines the references to the templates required for ClusterTemplate. + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Templates",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} + Templates Templates `json:"templates"` + // InputDataSchema encapsulates all the schemas required for ClusterTemplate. + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="InputDataSchema",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} InputDataSchema InputDataSchema `json:"inputDataSchema"` } @@ -78,6 +82,7 @@ type ClusterTemplateStatus struct { // ClusterTemplate is the Schema for the clustertemplates API // +kubebuilder:validation:XValidation:message="Spec changes are not allowed for a ClusterTemplate that has passed the validation", rule="!has(oldSelf.status) || oldSelf.status.conditions.exists(c, c.type=='ClusterTemplateValidated' && c.status=='False') || oldSelf.spec == self.spec" +// +operator-sdk:csv:customresourcedefinitions:displayName="ORAN O2IMS Cluster Template",resources={{ConfigMap, v1}} type ClusterTemplate struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` diff --git a/api/v1alpha1/groupversion_info.go b/api/v1alpha1/groupversion_info.go index 2b0b72f7..98d2d10b 100644 --- a/api/v1alpha1/groupversion_info.go +++ b/api/v1alpha1/groupversion_info.go @@ -16,7 +16,7 @@ limitations under the License. // Package v1alpha1 contains API Schema definitions for the oran v1alpha1 API group // +kubebuilder:object:generate=true -// +groupName=oran.openshift.io +// +groupName=o2ims.oran.openshift.io package v1alpha1 import ( @@ -26,7 +26,7 @@ import ( var ( // GroupVersion is group version used to register these objects - GroupVersion = schema.GroupVersion{Group: "oran.openshift.io", Version: "v1alpha1"} + GroupVersion = schema.GroupVersion{Group: "o2ims.oran.openshift.io", Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} diff --git a/api/v1alpha1/orano2ims_types.go b/api/v1alpha1/inventory_types.go similarity index 62% rename from api/v1alpha1/orano2ims_types.go rename to api/v1alpha1/inventory_types.go index e195d611..431b7a1d 100644 --- a/api/v1alpha1/orano2ims_types.go +++ b/api/v1alpha1/inventory_types.go @@ -55,13 +55,17 @@ type DeploymentManagerServerConfig struct { // ResourceServerConfig contains the configuration for the resource server. type ResourceServerConfig struct { //+kubebuilder:default:={enabled:true} + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="ServerConfig",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:bool"} ServerConfig `json:",inline"` //+optional + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="BackendURL",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} BackendURL string `json:"backendURL,omitempty"` //+optional + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="BackendToken",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} BackendToken string `json:"backendToken,omitempty"` // This field allows the addition of extra O-Cloud information for the resource server. //+optional + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Extensions",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} Extensions []string `json:"extensions,omitempty"` } @@ -71,38 +75,43 @@ type AlarmSubscriptionServerConfig struct { ServerConfig `json:",inline"` } -// ORANO2IMSSpec defines the desired state of ORANO2IMS -type ORANO2IMSSpec struct { - // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster - // Important: Run "make" to regenerate code after modifying this file - +// InventorySpec defines the desired state of Inventory +type InventorySpec struct { // Image is the full reference of the container image that contains the binary. This is // optional and the default will be the value passed to the `--image` command line flag of // the controller manager. - // //+optional + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Image",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} Image string `json:"image"` // CloudId is used to correlate the SMO inventory record with the deployed cloud instance. + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="CloudId",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} CloudId string `json:"cloudId"` //+optional + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="MetadataServerConfig",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} MetadataServerConfig MetadataServerConfig `json:"metadataServerConfig"` //+optional + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="DeploymentManagerServerConfig",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} DeploymentManagerServerConfig DeploymentManagerServerConfig `json:"deploymentManagerServerConfig"` + // ResourceServerConfig contains the configuration for the resource server. //+optional + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="ResourceServerConfig",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} ResourceServerConfig ResourceServerConfig `json:"resourceServerConfig,omitempty"` + // AlarmSubscriptionServerConfig contains the configuration for the alarm server. //+optional + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="AlarmSubscriptionServerConfig",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} AlarmSubscriptionServerConfig AlarmSubscriptionServerConfig `json:"alarmSubscriptionServerConfig"` // IngressHost defines the FQDN for the IMS endpoints. //+optional + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="IngressHost",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} IngressHost string `json:"ingressHost,omitempty"` } type DeploymentsStatus struct { - // +operator-sdk:csv:customresourcedefinitions:type=status,displayName="Deployment Server Status" + // +operator-sdk:csv:customresourcedefinitions:type=status,displayName="DeploymentServerStatus" DeploymentServerStatus string `json:"deploymentServerStatus,omitempty"` - // +operator-sdk:csv:customresourcedefinitions:type=status,displayName="Metadata Server Status" + // +operator-sdk:csv:customresourcedefinitions:type=status,displayName="MetadataServer tatus" MetadataServerStatus string `json:"metadataServerStatus,omitempty"` - // +operator-sdk:csv:customresourcedefinitions:type=status,displayName="Resource Server Status" + // +operator-sdk:csv:customresourcedefinitions:type=status,displayName="ResourceServerStatus" ResourceServerStatus string `json:"resourceServerStatus,omitempty"` // +operator-sdk:csv:customresourcedefinitions:type=status,displayName="Conditions" Conditions []metav1.Condition `json:"conditions,omitempty"` @@ -114,35 +123,37 @@ type UsedServerConfig struct { DeploymentManagerServerUsedConfig []string `json:"deploymentManagerServerUsedConfig,omitempty"` } -// ORANO2IMSStatus defines the observed state of ORANO2IMS -type ORANO2IMSStatus struct { +// InventoryStatus defines the observed state of Inventory +type InventoryStatus struct { // INSERT ADDITIONAL STATUS FIELD - define observed state of cluster // Important: Run "make" to regenerate code after modifying this file + // +operator-sdk:csv:customresourcedefinitions:type=status,displayName="DeploymentsStatus" DeploymentsStatus DeploymentsStatus `json:"deploymentStatus,omitempty"` - UsedServerConfig UsedServerConfig `json:"usedServerConfig,omitempty"` + // +operator-sdk:csv:customresourcedefinitions:type=status,displayName="DeploymentsStatus" + UsedServerConfig UsedServerConfig `json:"usedServerConfig,omitempty"` } -//+kubebuilder:object:root=true -//+kubebuilder:subresource:status - -// ORANO2IMS is the Schema for the orano2ims API -type ORANO2IMS struct { +// +kubebuilder:object:root=true +// +kubebuilder:subresource:status +// Inventory is the Schema for the Inventory API +// +operator-sdk:csv:customresourcedefinitions:displayName="ORAN O2IMS Inventory",resources={{Deployment,apps/v1}} +type Inventory struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` - Spec ORANO2IMSSpec `json:"spec,omitempty"` - Status ORANO2IMSStatus `json:"status,omitempty"` + Spec InventorySpec `json:"spec,omitempty"` + Status InventoryStatus `json:"status,omitempty"` } -//+kubebuilder:object:root=true - -// ORANO2IMSList contains a list of ORANO2IMS -type ORANO2IMSList struct { +// InventoryList contains a list of Inventory +// +// +kubebuilder:object:root=true +type InventoryList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` - Items []ORANO2IMS `json:"items"` + Items []Inventory `json:"items"` } func init() { - SchemeBuilder.Register(&ORANO2IMS{}, &ORANO2IMSList{}) + SchemeBuilder.Register(&Inventory{}, &InventoryList{}) } diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index 0690ea50..ed8eed3e 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -346,38 +346,7 @@ func (in *InputDataSchema) DeepCopy() *InputDataSchema { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *MetadataServerConfig) DeepCopyInto(out *MetadataServerConfig) { - *out = *in - out.ServerConfig = in.ServerConfig -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetadataServerConfig. -func (in *MetadataServerConfig) DeepCopy() *MetadataServerConfig { - if in == nil { - return nil - } - out := new(MetadataServerConfig) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *NodePoolRef) DeepCopyInto(out *NodePoolRef) { - *out = *in -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodePoolRef. -func (in *NodePoolRef) DeepCopy() *NodePoolRef { - if in == nil { - return nil - } - out := new(NodePoolRef) - in.DeepCopyInto(out) - return out -} - -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ORANO2IMS) DeepCopyInto(out *ORANO2IMS) { +func (in *Inventory) DeepCopyInto(out *Inventory) { *out = *in out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) @@ -385,18 +354,18 @@ func (in *ORANO2IMS) DeepCopyInto(out *ORANO2IMS) { in.Status.DeepCopyInto(&out.Status) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ORANO2IMS. -func (in *ORANO2IMS) DeepCopy() *ORANO2IMS { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Inventory. +func (in *Inventory) DeepCopy() *Inventory { if in == nil { return nil } - out := new(ORANO2IMS) + out := new(Inventory) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ORANO2IMS) DeepCopyObject() runtime.Object { +func (in *Inventory) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -404,31 +373,31 @@ func (in *ORANO2IMS) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ORANO2IMSList) DeepCopyInto(out *ORANO2IMSList) { +func (in *InventoryList) DeepCopyInto(out *InventoryList) { *out = *in out.TypeMeta = in.TypeMeta in.ListMeta.DeepCopyInto(&out.ListMeta) if in.Items != nil { in, out := &in.Items, &out.Items - *out = make([]ORANO2IMS, len(*in)) + *out = make([]Inventory, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) } } } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ORANO2IMSList. -func (in *ORANO2IMSList) DeepCopy() *ORANO2IMSList { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InventoryList. +func (in *InventoryList) DeepCopy() *InventoryList { if in == nil { return nil } - out := new(ORANO2IMSList) + out := new(InventoryList) in.DeepCopyInto(out) return out } // DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object. -func (in *ORANO2IMSList) DeepCopyObject() runtime.Object { +func (in *InventoryList) DeepCopyObject() runtime.Object { if c := in.DeepCopy(); c != nil { return c } @@ -436,7 +405,7 @@ func (in *ORANO2IMSList) DeepCopyObject() runtime.Object { } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ORANO2IMSSpec) DeepCopyInto(out *ORANO2IMSSpec) { +func (in *InventorySpec) DeepCopyInto(out *InventorySpec) { *out = *in out.MetadataServerConfig = in.MetadataServerConfig in.DeploymentManagerServerConfig.DeepCopyInto(&out.DeploymentManagerServerConfig) @@ -444,29 +413,60 @@ func (in *ORANO2IMSSpec) DeepCopyInto(out *ORANO2IMSSpec) { out.AlarmSubscriptionServerConfig = in.AlarmSubscriptionServerConfig } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ORANO2IMSSpec. -func (in *ORANO2IMSSpec) DeepCopy() *ORANO2IMSSpec { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InventorySpec. +func (in *InventorySpec) DeepCopy() *InventorySpec { if in == nil { return nil } - out := new(ORANO2IMSSpec) + out := new(InventorySpec) in.DeepCopyInto(out) return out } // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *ORANO2IMSStatus) DeepCopyInto(out *ORANO2IMSStatus) { +func (in *InventoryStatus) DeepCopyInto(out *InventoryStatus) { *out = *in in.DeploymentsStatus.DeepCopyInto(&out.DeploymentsStatus) in.UsedServerConfig.DeepCopyInto(&out.UsedServerConfig) } -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ORANO2IMSStatus. -func (in *ORANO2IMSStatus) DeepCopy() *ORANO2IMSStatus { +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InventoryStatus. +func (in *InventoryStatus) DeepCopy() *InventoryStatus { if in == nil { return nil } - out := new(ORANO2IMSStatus) + out := new(InventoryStatus) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *MetadataServerConfig) DeepCopyInto(out *MetadataServerConfig) { + *out = *in + out.ServerConfig = in.ServerConfig +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetadataServerConfig. +func (in *MetadataServerConfig) DeepCopy() *MetadataServerConfig { + if in == nil { + return nil + } + out := new(MetadataServerConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *NodePoolRef) DeepCopyInto(out *NodePoolRef) { + *out = *in +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodePoolRef. +func (in *NodePoolRef) DeepCopy() *NodePoolRef { + if in == nil { + return nil + } + out := new(NodePoolRef) in.DeepCopyInto(out) return out } diff --git a/bundle.Dockerfile b/bundle.Dockerfile index 6ba38eee..2e9e0428 100644 --- a/bundle.Dockerfile +++ b/bundle.Dockerfile @@ -8,7 +8,7 @@ LABEL operators.operatorframework.io.bundle.package.v1=oran-o2ims LABEL operators.operatorframework.io.bundle.channels.v1=alpha LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.36.1 LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1 -LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3 +LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v4 # Labels for testing. LABEL operators.operatorframework.io.test.mediatype.v1=scorecard+v1 diff --git a/bundle/manifests/hardwaremanagement.oran.openshift.io_nodepools.yaml b/bundle/manifests/o2ims-hardwaremanagement.oran.openshift.io_nodepools.yaml similarity index 97% rename from bundle/manifests/hardwaremanagement.oran.openshift.io_nodepools.yaml rename to bundle/manifests/o2ims-hardwaremanagement.oran.openshift.io_nodepools.yaml index 7ac710de..574dfcd4 100644 --- a/bundle/manifests/hardwaremanagement.oran.openshift.io_nodepools.yaml +++ b/bundle/manifests/o2ims-hardwaremanagement.oran.openshift.io_nodepools.yaml @@ -4,9 +4,9 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.15.0 creationTimestamp: null - name: nodepools.hardwaremanagement.oran.openshift.io + name: nodepools.o2ims-hardwaremanagement.oran.openshift.io spec: - group: hardwaremanagement.oran.openshift.io + group: o2ims-hardwaremanagement.oran.openshift.io names: kind: NodePool listKind: NodePoolList @@ -48,6 +48,7 @@ spec: statistics. type: string location: + description: Location type: string nodeGroup: items: @@ -65,6 +66,7 @@ spec: type: object type: array site: + description: Site type: string required: - cloudID diff --git a/bundle/manifests/hardwaremanagement.oran.openshift.io_nodes.yaml b/bundle/manifests/o2ims-hardwaremanagement.oran.openshift.io_nodes.yaml similarity index 96% rename from bundle/manifests/hardwaremanagement.oran.openshift.io_nodes.yaml rename to bundle/manifests/o2ims-hardwaremanagement.oran.openshift.io_nodes.yaml index a1c2180e..6d562baf 100644 --- a/bundle/manifests/hardwaremanagement.oran.openshift.io_nodes.yaml +++ b/bundle/manifests/o2ims-hardwaremanagement.oran.openshift.io_nodes.yaml @@ -4,9 +4,9 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.15.0 creationTimestamp: null - name: nodes.hardwaremanagement.oran.openshift.io + name: nodes.o2ims-hardwaremanagement.oran.openshift.io spec: - group: hardwaremanagement.oran.openshift.io + group: o2ims-hardwaremanagement.oran.openshift.io names: kind: Node listKind: NodeList @@ -40,10 +40,13 @@ spec: description: NodeSpec describes a node presents a hardware server properties: groupName: + description: GroupName type: string hwProfile: + description: HwProfile type: string nodePool: + description: NodePool type: string required: - groupName diff --git a/bundle/manifests/oran.openshift.io_clusterrequests.yaml b/bundle/manifests/o2ims.oran.openshift.io_clusterrequests.yaml similarity index 98% rename from bundle/manifests/oran.openshift.io_clusterrequests.yaml rename to bundle/manifests/o2ims.oran.openshift.io_clusterrequests.yaml index d06c4c45..2f13d92e 100644 --- a/bundle/manifests/oran.openshift.io_clusterrequests.yaml +++ b/bundle/manifests/o2ims.oran.openshift.io_clusterrequests.yaml @@ -4,9 +4,9 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.15.0 creationTimestamp: null - name: clusterrequests.oran.openshift.io + name: clusterrequests.o2ims.oran.openshift.io spec: - group: oran.openshift.io + group: o2ims.oran.openshift.io names: kind: ClusterRequest listKind: ClusterRequestList @@ -62,12 +62,12 @@ spec: - policyTemplateInput type: object clusterTemplateRef: - description: ClusterTemplateRef references an existing ClusterTemplate - CR. type: string location: + description: Location type: string site: + description: Site type: string timeout: description: |- diff --git a/bundle/manifests/oran.openshift.io_clustertemplates.yaml b/bundle/manifests/o2ims.oran.openshift.io_clustertemplates.yaml similarity index 99% rename from bundle/manifests/oran.openshift.io_clustertemplates.yaml rename to bundle/manifests/o2ims.oran.openshift.io_clustertemplates.yaml index 450f0451..069b7ce0 100644 --- a/bundle/manifests/oran.openshift.io_clustertemplates.yaml +++ b/bundle/manifests/o2ims.oran.openshift.io_clustertemplates.yaml @@ -4,9 +4,9 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.15.0 creationTimestamp: null - name: clustertemplates.oran.openshift.io + name: clustertemplates.o2ims.oran.openshift.io spec: - group: oran.openshift.io + group: o2ims.oran.openshift.io names: kind: ClusterTemplate listKind: ClusterTemplateList diff --git a/bundle/manifests/oran.openshift.io_orano2imses.yaml b/bundle/manifests/o2ims.oran.openshift.io_inventories.yaml similarity index 96% rename from bundle/manifests/oran.openshift.io_orano2imses.yaml rename to bundle/manifests/o2ims.oran.openshift.io_inventories.yaml index 89dd679e..3fa4dcb4 100644 --- a/bundle/manifests/oran.openshift.io_orano2imses.yaml +++ b/bundle/manifests/o2ims.oran.openshift.io_inventories.yaml @@ -4,20 +4,20 @@ metadata: annotations: controller-gen.kubebuilder.io/version: v0.15.0 creationTimestamp: null - name: orano2imses.oran.openshift.io + name: inventories.o2ims.oran.openshift.io spec: - group: oran.openshift.io + group: o2ims.oran.openshift.io names: - kind: ORANO2IMS - listKind: ORANO2IMSList - plural: orano2imses - singular: orano2ims + kind: Inventory + listKind: InventoryList + plural: inventories + singular: inventory scope: Namespaced versions: - name: v1alpha1 schema: openAPIV3Schema: - description: ORANO2IMS is the Schema for the orano2ims API + description: Inventory is the Schema for the Inventory API properties: apiVersion: description: |- @@ -37,13 +37,13 @@ spec: metadata: type: object spec: - description: ORANO2IMSSpec defines the desired state of ORANO2IMS + description: InventorySpec defines the desired state of Inventory properties: alarmSubscriptionServerConfig: default: enabled: true description: AlarmSubscriptionServerConfig contains the configuration - for the alarm subscription server. + for the alarm server. properties: enabled: default: true @@ -134,7 +134,7 @@ spec: - cloudId type: object status: - description: ORANO2IMSStatus defines the observed state of ORANO2IMS + description: InventoryStatus defines the observed state of Inventory properties: deploymentStatus: description: |- diff --git a/bundle/manifests/oran-o2ims.clusterserviceversion.yaml b/bundle/manifests/oran-o2ims.clusterserviceversion.yaml index 5fd642f8..a35f93d3 100644 --- a/bundle/manifests/oran-o2ims.clusterserviceversion.yaml +++ b/bundle/manifests/oran-o2ims.clusterserviceversion.yaml @@ -5,7 +5,7 @@ metadata: alm-examples: |- [ { - "apiVersion": "oran.openshift.io/v1alpha1", + "apiVersion": "o2ims.oran.openshift.io/v1alpha1", "kind": "ClusterRequest", "metadata": { "labels": { @@ -200,7 +200,7 @@ metadata: } }, { - "apiVersion": "oran.openshift.io/v1alpha1", + "apiVersion": "o2ims.oran.openshift.io/v1alpha1", "kind": "ClusterTemplate", "metadata": { "labels": { @@ -420,22 +420,45 @@ metadata: "nodes" ], "type": "object" + }, + "policyTemplateSchema": { + "description": "policyTemplateSchema defines the available parameters for cluster configuration", + "policyTemplateSchema": null, + "properties": { + "cpu-isolated": { + "type": "string" + }, + "sriov-network-pfNames-1": { + "type": "string" + }, + "sriov-network-pfNames-2": { + "type": "string" + }, + "sriov-network-vlan-1": { + "type": "string" + }, + "sriov-network-vlan-2": { + "type": "string" + } + } } }, "templates": { - "clusterInstanceDefaults": "clustertemplate-sample-ci-defaults" + "clusterInstanceDefaults": "clusterinstance-defaults-v1", + "hwTemplate": "hwtemplate-configmap-v1", + "policyTemplateDefaults": "policytemplate-defaults-v1" } } }, { - "apiVersion": "oran.openshift.io/v1alpha1", - "kind": "ORANO2IMS", + "apiVersion": "o2ims.oran.openshift.io/v1alpha1", + "kind": "Inventory", "metadata": { "labels": { "app.kubernetes.io/created-by": "oran-o2ims", - "app.kubernetes.io/instance": "orano2ims-sample", + "app.kubernetes.io/instance": "inventory-sample", "app.kubernetes.io/managed-by": "kustomize", - "app.kubernetes.io/name": "orano2ims", + "app.kubernetes.io/name": "inventory", "app.kubernetes.io/part-of": "oran-o2ims" }, "name": "sample", @@ -464,35 +487,208 @@ metadata: features.operators.openshift.io/token-auth-aws: "false" features.operators.openshift.io/token-auth-azure: "false" features.operators.openshift.io/token-auth-gcp: "false" - olm.skipRange: '>=4.16.0 <4.16.999' + olm.skipRange: '>=4.16.0 <4.18' operators.openshift.io/infrastructure-features: '["disconnected"]' operators.operatorframework.io/builder: operator-sdk-v1.36.1 - operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 + operators.operatorframework.io/project_layout: go.kubebuilder.io/v4 provider: Red Hat repository: https://github.com/openshift-kni/oran-o2ims support: Red Hat labels: operatorframework.io/arch.amd64: supported - name: oran-o2ims.v4.16.0 + name: oran-o2ims.v4.17.0 namespace: placeholder spec: apiservicedefinitions: {} customresourcedefinitions: owned: - - kind: ClusterRequest - name: clusterrequests.oran.openshift.io + - description: ClusterRequest is the Schema for the clusterrequests API + displayName: ORAN O2IMS Cluster Request + kind: ClusterRequest + name: clusterrequests.o2ims.oran.openshift.io + resources: + - kind: ClusterInstance + name: "" + version: siteconfig.open-cluster-management.io/v1alpha1 + - kind: Namespace + name: "" + version: v1 + specDescriptors: + - displayName: ClusterTemplateInput + path: clusterTemplateInput + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: ClusterTemplateRef + path: clusterTemplateRef + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: Location + displayName: Location + path: location + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: Site + displayName: Site + path: site + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: Timeout + path: timeout + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text version: v1alpha1 - - kind: ClusterTemplate - name: clustertemplates.oran.openshift.io + - description: ClusterTemplate is the Schema for the clustertemplates API + displayName: ORAN O2IMS Cluster Template + kind: ClusterTemplate + name: clustertemplates.o2ims.oran.openshift.io + resources: + - kind: ConfigMap + name: "" + version: v1 + specDescriptors: + - description: InputDataSchema encapsulates all the schemas required for ClusterTemplate. + displayName: InputDataSchema + path: inputDataSchema + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: Templates defines the references to the templates required for + ClusterTemplate. + displayName: Templates + path: templates + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text version: v1alpha1 - - kind: NodePool - name: nodepools.hardwaremanagement.oran.openshift.io + - description: Inventory is the Schema for the Inventory API + displayName: ORAN O2IMS Inventory + kind: Inventory + name: inventories.o2ims.oran.openshift.io + resources: + - kind: Deployment + name: "" + version: apps/v1 + specDescriptors: + - description: AlarmSubscriptionServerConfig contains the configuration for + the alarm server. + displayName: AlarmSubscriptionServerConfig + path: alarmSubscriptionServerConfig + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: CloudId is used to correlate the SMO inventory record with the + deployed cloud instance. + displayName: CloudId + path: cloudId + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: DeploymentManagerServerConfig + path: deploymentManagerServerConfig + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: |- + Image is the full reference of the container image that contains the binary. This is + optional and the default will be the value passed to the `--image` command line flag of + the controller manager. + displayName: Image + path: image + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: IngressHost defines the FQDN for the IMS endpoints. + displayName: IngressHost + path: ingressHost + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: MetadataServerConfig + path: metadataServerConfig + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: ResourceServerConfig contains the configuration for the resource + server. + displayName: ResourceServerConfig + path: resourceServerConfig + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: BackendToken + path: resourceServerConfig.backendToken + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: BackendURL + path: resourceServerConfig.backendURL + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: This field allows the addition of extra O-Cloud information for + the resource server. + displayName: Extensions + path: resourceServerConfig.extensions + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + statusDescriptors: + - description: |- + INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + Important: Run "make" to regenerate code after modifying this file + displayName: DeploymentsStatus + path: deploymentStatus + - displayName: Conditions + path: deploymentStatus.conditions + - displayName: DeploymentServerStatus + path: deploymentStatus.deploymentServerStatus + - displayName: MetadataServer tatus + path: deploymentStatus.metadataServerStatus + - displayName: ResourceServerStatus + path: deploymentStatus.resourceServerStatus + - displayName: DeploymentsStatus + path: usedServerConfig version: v1alpha1 - - kind: Node - name: nodes.hardwaremanagement.oran.openshift.io + - description: NodePool is the schema for an allocation request of nodes + displayName: ORAN O2IMS Cluster Request + kind: NodePool + name: nodepools.o2ims-hardwaremanagement.oran.openshift.io + resources: + - kind: Namespace + name: "" + version: v1 + specDescriptors: + - description: |- + 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. + displayName: CloudID + path: cloudID + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: Location + displayName: Location + path: location + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: Site + displayName: Site + path: site + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text version: v1alpha1 - - kind: ORANO2IMS - name: orano2imses.oran.openshift.io + - description: Node is the schema for an allocated node + displayName: ORAN O2IMS Cluster Request + kind: Node + name: nodes.o2ims-hardwaremanagement.oran.openshift.io + resources: + - kind: Namespace + name: "" + version: v1 + specDescriptors: + - description: GroupName + displayName: GroupName + path: groupName + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: HwProfile + displayName: HwProfile + path: hwProfile + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: NodePool + displayName: NodePool + path: nodePool + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text version: v1alpha1 description: | # O-RAN O2IMS operator @@ -639,7 +835,7 @@ spec: - apiGroups: - oran.openshift.io resources: - - clusterrequests + - Inventoryes verbs: - create - delete @@ -651,13 +847,13 @@ spec: - apiGroups: - oran.openshift.io resources: - - clusterrequests/finalizers + - Inventoryes/finalizers verbs: - update - apiGroups: - oran.openshift.io resources: - - clusterrequests/status + - Inventoryes/status verbs: - get - patch @@ -665,7 +861,7 @@ spec: - apiGroups: - oran.openshift.io resources: - - clustertemplates + - clusterrequests verbs: - create - delete @@ -677,13 +873,13 @@ spec: - apiGroups: - oran.openshift.io resources: - - clustertemplates/finalizers + - clusterrequests/finalizers verbs: - update - apiGroups: - oran.openshift.io resources: - - clustertemplates/status + - clusterrequests/status verbs: - get - patch @@ -691,7 +887,7 @@ spec: - apiGroups: - oran.openshift.io resources: - - orano2imses + - clustertemplates verbs: - create - delete @@ -703,13 +899,13 @@ spec: - apiGroups: - oran.openshift.io resources: - - orano2imses/finalizers + - clustertemplates/finalizers verbs: - update - apiGroups: - oran.openshift.io resources: - - orano2imses/status + - clustertemplates/status verbs: - get - patch @@ -828,8 +1024,8 @@ spec: - --leader-elect env: - name: IMAGE - value: quay.io/openshift-kni/oran-o2ims-operator:4.16.0 - image: quay.io/openshift-kni/oran-o2ims-operator:4.16.0 + value: quay.io/openshift-kni/oran-o2ims-operator:4.17.0 + image: quay.io/openshift-kni/oran-o2ims-operator:4.17.0 livenessProbe: httpGet: path: /healthz @@ -920,4 +1116,4 @@ spec: provider: name: Red Hat replaces: oran-o2ims.v0.0.0 - version: 4.16.0 + version: 4.17.0 diff --git a/bundle/metadata/annotations.yaml b/bundle/metadata/annotations.yaml index 16e4c09e..1e6a61d9 100644 --- a/bundle/metadata/annotations.yaml +++ b/bundle/metadata/annotations.yaml @@ -7,7 +7,7 @@ annotations: operators.operatorframework.io.bundle.channels.v1: alpha operators.operatorframework.io.metrics.builder: operator-sdk-v1.36.1 operators.operatorframework.io.metrics.mediatype.v1: metrics+v1 - operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3 + operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v4 # Annotations for testing. operators.operatorframework.io.test.mediatype.v1: scorecard+v1 diff --git a/config/crd/bases/hardwaremanagement.oran.openshift.io_nodepools.yaml b/config/crd/bases/o2ims-hardwaremanagement.oran.openshift.io_nodepools.yaml similarity index 97% rename from config/crd/bases/hardwaremanagement.oran.openshift.io_nodepools.yaml rename to config/crd/bases/o2ims-hardwaremanagement.oran.openshift.io_nodepools.yaml index aea11f6d..95f8baac 100644 --- a/config/crd/bases/hardwaremanagement.oran.openshift.io_nodepools.yaml +++ b/config/crd/bases/o2ims-hardwaremanagement.oran.openshift.io_nodepools.yaml @@ -4,9 +4,9 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.15.0 - name: nodepools.hardwaremanagement.oran.openshift.io + name: nodepools.o2ims-hardwaremanagement.oran.openshift.io spec: - group: hardwaremanagement.oran.openshift.io + group: o2ims-hardwaremanagement.oran.openshift.io names: kind: NodePool listKind: NodePoolList @@ -48,6 +48,7 @@ spec: statistics. type: string location: + description: Location type: string nodeGroup: items: @@ -65,6 +66,7 @@ spec: type: object type: array site: + description: Site type: string required: - cloudID diff --git a/config/crd/bases/hardwaremanagement.oran.openshift.io_nodes.yaml b/config/crd/bases/o2ims-hardwaremanagement.oran.openshift.io_nodes.yaml similarity index 96% rename from config/crd/bases/hardwaremanagement.oran.openshift.io_nodes.yaml rename to config/crd/bases/o2ims-hardwaremanagement.oran.openshift.io_nodes.yaml index d782999f..554f170e 100644 --- a/config/crd/bases/hardwaremanagement.oran.openshift.io_nodes.yaml +++ b/config/crd/bases/o2ims-hardwaremanagement.oran.openshift.io_nodes.yaml @@ -4,9 +4,9 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.15.0 - name: nodes.hardwaremanagement.oran.openshift.io + name: nodes.o2ims-hardwaremanagement.oran.openshift.io spec: - group: hardwaremanagement.oran.openshift.io + group: o2ims-hardwaremanagement.oran.openshift.io names: kind: Node listKind: NodeList @@ -40,10 +40,13 @@ spec: description: NodeSpec describes a node presents a hardware server properties: groupName: + description: GroupName type: string hwProfile: + description: HwProfile type: string nodePool: + description: NodePool type: string required: - groupName diff --git a/config/crd/bases/oran.openshift.io_clusterrequests.yaml b/config/crd/bases/o2ims.oran.openshift.io_clusterrequests.yaml similarity index 98% rename from config/crd/bases/oran.openshift.io_clusterrequests.yaml rename to config/crd/bases/o2ims.oran.openshift.io_clusterrequests.yaml index 17c84ade..2059afdd 100644 --- a/config/crd/bases/oran.openshift.io_clusterrequests.yaml +++ b/config/crd/bases/o2ims.oran.openshift.io_clusterrequests.yaml @@ -4,9 +4,9 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.15.0 - name: clusterrequests.oran.openshift.io + name: clusterrequests.o2ims.oran.openshift.io spec: - group: oran.openshift.io + group: o2ims.oran.openshift.io names: kind: ClusterRequest listKind: ClusterRequestList @@ -62,12 +62,12 @@ spec: - policyTemplateInput type: object clusterTemplateRef: - description: ClusterTemplateRef references an existing ClusterTemplate - CR. type: string location: + description: Location type: string site: + description: Site type: string timeout: description: |- diff --git a/config/crd/bases/oran.openshift.io_clustertemplates.yaml b/config/crd/bases/o2ims.oran.openshift.io_clustertemplates.yaml similarity index 99% rename from config/crd/bases/oran.openshift.io_clustertemplates.yaml rename to config/crd/bases/o2ims.oran.openshift.io_clustertemplates.yaml index 113626ff..8be051b3 100644 --- a/config/crd/bases/oran.openshift.io_clustertemplates.yaml +++ b/config/crd/bases/o2ims.oran.openshift.io_clustertemplates.yaml @@ -4,9 +4,9 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.15.0 - name: clustertemplates.oran.openshift.io + name: clustertemplates.o2ims.oran.openshift.io spec: - group: oran.openshift.io + group: o2ims.oran.openshift.io names: kind: ClusterTemplate listKind: ClusterTemplateList diff --git a/config/crd/bases/oran.openshift.io_orano2imses.yaml b/config/crd/bases/o2ims.oran.openshift.io_inventories.yaml similarity index 96% rename from config/crd/bases/oran.openshift.io_orano2imses.yaml rename to config/crd/bases/o2ims.oran.openshift.io_inventories.yaml index 17e6b094..95303d3c 100644 --- a/config/crd/bases/oran.openshift.io_orano2imses.yaml +++ b/config/crd/bases/o2ims.oran.openshift.io_inventories.yaml @@ -4,20 +4,20 @@ kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.15.0 - name: orano2imses.oran.openshift.io + name: inventories.o2ims.oran.openshift.io spec: - group: oran.openshift.io + group: o2ims.oran.openshift.io names: - kind: ORANO2IMS - listKind: ORANO2IMSList - plural: orano2imses - singular: orano2ims + kind: Inventory + listKind: InventoryList + plural: inventories + singular: inventory scope: Namespaced versions: - name: v1alpha1 schema: openAPIV3Schema: - description: ORANO2IMS is the Schema for the orano2ims API + description: Inventory is the Schema for the Inventory API properties: apiVersion: description: |- @@ -37,13 +37,13 @@ spec: metadata: type: object spec: - description: ORANO2IMSSpec defines the desired state of ORANO2IMS + description: InventorySpec defines the desired state of Inventory properties: alarmSubscriptionServerConfig: default: enabled: true description: AlarmSubscriptionServerConfig contains the configuration - for the alarm subscription server. + for the alarm server. properties: enabled: default: true @@ -134,7 +134,7 @@ spec: - cloudId type: object status: - description: ORANO2IMSStatus defines the observed state of ORANO2IMS + description: InventoryStatus defines the observed state of Inventory properties: deploymentStatus: description: |- diff --git a/config/crd/bases/oran.openshift.io_nodepools.yaml b/config/crd/bases/oran.openshift.io_nodepools.yaml deleted file mode 100644 index 78a95c1a..00000000 --- a/config/crd/bases/oran.openshift.io_nodepools.yaml +++ /dev/null @@ -1,164 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.15.0 - name: nodepools.oran.openshift.io -spec: - group: oran.openshift.io - names: - kind: NodePool - listKind: NodePoolList - plural: nodepools - shortNames: - - np - singular: nodepool - scope: Namespaced - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: NodePool is the schema for an allocation request of nodes - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: NodePoolSpec describes a pool of nodes to allocate - properties: - cloudID: - description: |- - 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. - type: string - location: - type: string - nodeGroup: - items: - properties: - hwProfile: - type: string - name: - type: string - size: - type: integer - required: - - hwProfile - - name - - size - type: object - type: array - site: - type: string - required: - - cloudID - - nodeGroup - - site - type: object - status: - description: |- - NodePoolStatus describes the observed state of a request to allocate and prepare - a node that will eventually be part of a deployment manager. - properties: - conditions: - description: |- - Conditions represent the observations of the current state of the NodePool. Possible - values of the condition type are `Provisioned`, `Unprovisioned`, `Updating` and `Failed`. - items: - description: "Condition contains details for one aspect of the current - state of this API Resource.\n---\nThis struct is intended for - direct use as an array at the field path .status.conditions. For - example,\n\n\n\ttype FooStatus struct{\n\t // Represents the - observations of a foo's current state.\n\t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // - +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t - \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" - patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t - \ // other fields\n\t}" - properties: - lastTransitionTime: - description: |- - lastTransitionTime is the last time the condition transitioned from one status to another. - This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - format: date-time - type: string - message: - description: |- - message is a human readable message indicating details about the transition. - This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: |- - observedGeneration represents the .metadata.generation that the condition was set based upon. - For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date - with respect to the current state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: |- - reason contains a programmatic identifier indicating the reason for the condition's last transition. - Producers of specific condition types may define expected values and meanings for this field, - and whether the values are considered a guaranteed API. - The value should be a CamelCase string. - This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: |- - type of condition in CamelCase or in foo.example.com/CamelCase. - --- - Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be - useful (see .node.status.conditions), the ability to deconflict is important. - The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - type: array - properties: - description: Properties represents the node properties in the pool - properties: - nodeNames: - items: - type: string - type: array - type: object - type: object - type: object - served: true - storage: true - subresources: - status: {} diff --git a/config/crd/bases/oran.openshift.io_nodes.yaml b/config/crd/bases/oran.openshift.io_nodes.yaml deleted file mode 100644 index 8192c8bb..00000000 --- a/config/crd/bases/oran.openshift.io_nodes.yaml +++ /dev/null @@ -1,146 +0,0 @@ ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.15.0 - name: nodes.oran.openshift.io -spec: - group: oran.openshift.io - names: - kind: Node - listKind: NodeList - plural: nodes - singular: node - scope: Namespaced - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - properties: - apiVersion: - description: |- - APIVersion defines the versioned schema of this representation of an object. - Servers should convert recognized schemas to the latest internal value, and - may reject unrecognized values. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - type: string - kind: - description: |- - Kind is a string value representing the REST resource this object represents. - Servers may infer this from the endpoint the client submits requests to. - Cannot be updated. - In CamelCase. - More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - type: string - metadata: - type: object - spec: - description: NodeSpec describes a node presents a hardware server - properties: - groupName: - type: string - hwProfile: - type: string - nodePool: - type: string - required: - - groupName - - hwProfile - - nodePool - type: object - status: - description: |- - NodePoolStatus describes the observed state of a request to allocate and prepare - a node that will eventually be part of a deployment manager. - properties: - bmc: - properties: - address: - description: Address contains the URL for accessing the BMC over - the network. - type: string - credentialsName: - description: |- - CredentialsName is a reference to a secret containing the credentials. That secret - should contain the keys `username` and `password`. - type: string - type: object - conditions: - description: |- - Conditions represent the observations of the current state of the NodePool. Possible - values of the condition type are `Provisioned`, `Unprovisioned`, `Updating` and `Failed`. - items: - description: "Condition contains details for one aspect of the current - state of this API Resource.\n---\nThis struct is intended for - direct use as an array at the field path .status.conditions. For - example,\n\n\n\ttype FooStatus struct{\n\t // Represents the - observations of a foo's current state.\n\t // Known .status.conditions.type - are: \"Available\", \"Progressing\", and \"Degraded\"\n\t // - +patchMergeKey=type\n\t // +patchStrategy=merge\n\t // +listType=map\n\t - \ // +listMapKey=type\n\t Conditions []metav1.Condition `json:\"conditions,omitempty\" - patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"`\n\n\n\t - \ // other fields\n\t}" - properties: - lastTransitionTime: - description: |- - lastTransitionTime is the last time the condition transitioned from one status to another. - This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. - format: date-time - type: string - message: - description: |- - message is a human readable message indicating details about the transition. - This may be an empty string. - maxLength: 32768 - type: string - observedGeneration: - description: |- - observedGeneration represents the .metadata.generation that the condition was set based upon. - For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date - with respect to the current state of the instance. - format: int64 - minimum: 0 - type: integer - reason: - description: |- - reason contains a programmatic identifier indicating the reason for the condition's last transition. - Producers of specific condition types may define expected values and meanings for this field, - and whether the values are considered a guaranteed API. - The value should be a CamelCase string. - This field may not be empty. - maxLength: 1024 - minLength: 1 - pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ - type: string - status: - description: status of the condition, one of True, False, Unknown. - enum: - - "True" - - "False" - - Unknown - type: string - type: - description: |- - type of condition in CamelCase or in foo.example.com/CamelCase. - --- - Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be - useful (see .node.status.conditions), the ability to deconflict is important. - The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) - maxLength: 316 - pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ - type: string - required: - - lastTransitionTime - - message - - reason - - status - - type - type: object - type: array - type: object - type: object - served: true - storage: true - subresources: - status: {} diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index 388918e7..a9eb8939 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -1,15 +1,15 @@ resources: # Inventory: -- bases/oran.openshift.io_orano2imses.yaml +- bases/o2ims.oran.openshift.io_inventories.yaml # Hardware management: -- bases/hardwaremanagement.oran.openshift.io_nodepools.yaml -- bases/hardwaremanagement.oran.openshift.io_nodes.yaml +- bases/o2ims-hardwaremanagement.oran.openshift.io_nodepools.yaml +- bases/o2ims-hardwaremanagement.oran.openshift.io_nodes.yaml # Provisioning: -- bases/oran.openshift.io_clustertemplates.yaml -- bases/oran.openshift.io_clusterrequests.yaml +- bases/o2ims.oran.openshift.io_clustertemplates.yaml +- bases/o2ims.oran.openshift.io_clusterrequests.yaml configurations: - kustomizeconfig.yaml diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 1d50f06b..f0777186 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -10,7 +10,7 @@ generatorOptions: images: - name: controller newName: quay.io/openshift-kni/oran-o2ims-operator - newTag: 4.16.0 + newTag: 4.17.0 # This replacment copies the controller image into the `IMAGE` environment variable of the pod, diff --git a/config/manifests/bases/oran-o2ims.clusterserviceversion.yaml b/config/manifests/bases/oran-o2ims.clusterserviceversion.yaml index 64820b71..aacebe41 100644 --- a/config/manifests/bases/oran-o2ims.clusterserviceversion.yaml +++ b/config/manifests/bases/oran-o2ims.clusterserviceversion.yaml @@ -17,32 +17,285 @@ metadata: features.operators.openshift.io/token-auth-aws: "false" features.operators.openshift.io/token-auth-azure: "false" features.operators.openshift.io/token-auth-gcp: "false" - olm.skipRange: '>=4.16.0 <4.16.999' + olm.skipRange: '>=4.16.0 <4.18' operators.openshift.io/infrastructure-features: '["disconnected"]' provider: Red Hat repository: https://github.com/openshift-kni/oran-o2ims support: Red Hat labels: operatorframework.io/arch.amd64: supported - name: oran-o2ims.v4.16.0 + name: oran-o2ims.v4.17.0 namespace: placeholder spec: apiservicedefinitions: {} customresourcedefinitions: owned: - description: ORANO2IMS is the Schema for the orano2ims API - displayName: ORANO2 IMS + displayName: ORAN O2IMS Inventory kind: ORANO2IMS - name: orano2ims.oran.openshift.io + name: orano2ims.o2ims.oran.openshift.io + resources: + - kind: Deployment + name: "" + version: apps/v1 + specDescriptors: + - description: AlarmSubscriptionServerConfig contains the configuration for + the alarm server. + displayName: AlarmSubscriptionServerConfig + path: alarmSubscriptionServerConfig + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: CloudId is used to correlate the SMO inventory record with the + deployed cloud instance. + displayName: CloudId + path: cloudId + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: DeploymentManagerServerConfig + path: deploymentManagerServerConfig + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: |- + Image is the full reference of the container image that contains the binary. This is + optional and the default will be the value passed to the `--image` command line flag of + the controller manager. + displayName: Image + path: image + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: IngressHost defines the FQDN for the IMS endpoints. + displayName: IngressHost + path: ingressHost + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: MetadataServerConfig + path: metadataServerConfig + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: ResourceServerConfig contains the configuration for the resource + server. + displayName: ResourceServerConfig + path: resourceServerConfig + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: BackendToken + path: resourceServerConfig.backendToken + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: BackendURL + path: resourceServerConfig.backendURL + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: This field allows the addition of extra O-Cloud information for + the resource server. + displayName: Extensions + path: resourceServerConfig.extensions + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text statusDescriptors: + - description: |- + INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + Important: Run "make" to regenerate code after modifying this file + displayName: DeploymentsStatus + path: deploymentStatus - displayName: Conditions path: deploymentStatus.conditions - - displayName: Deployment Server Status + - displayName: DeploymentServerStatus path: deploymentStatus.deploymentServerStatus - - displayName: Metadata Server Status + - displayName: MetadataServer tatus path: deploymentStatus.metadataServerStatus - - displayName: Resource Server Status + - displayName: ResourceServerStatus path: deploymentStatus.resourceServerStatus + - displayName: DeploymentsStatus + path: usedServerConfig + version: v1alpha1 + - description: ClusterRequest is the Schema for the clusterrequests API + displayName: ORAN O2IMS Cluster Request + kind: ClusterRequest + name: clusterrequests.o2ims.oran.openshift.io + resources: + - kind: ClusterInstance + name: "" + version: siteconfig.open-cluster-management.io/v1alpha1 + - kind: Namespace + name: "" + version: v1 + specDescriptors: + - displayName: ClusterTemplateInput + path: clusterTemplateInput + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: ClusterTemplateRef + path: clusterTemplateRef + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: Location + displayName: Location + path: location + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: Site + displayName: Site + path: site + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: Timeout + path: timeout + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + version: v1alpha1 + - description: ClusterTemplate is the Schema for the clustertemplates API + displayName: ORAN O2IMS Cluster Template + kind: ClusterTemplate + name: clustertemplates.o2ims.oran.openshift.io + resources: + - kind: ConfigMap + name: "" + version: v1 + specDescriptors: + - description: InputDataSchema encapsulates all the schemas required for ClusterTemplate. + displayName: InputDataSchema + path: inputDataSchema + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: Templates defines the references to the templates required for + ClusterTemplate. + displayName: Templates + path: templates + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + version: v1alpha1 + - description: Inventory is the Schema for the Inventory API + displayName: ORAN O2IMS Inventory + kind: Inventory + name: inventories.o2ims.oran.openshift.io + resources: + - kind: Deployment + name: "" + version: apps/v1 + specDescriptors: + - description: AlarmSubscriptionServerConfig contains the configuration for + the alarm server. + displayName: AlarmSubscriptionServerConfig + path: alarmSubscriptionServerConfig + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: CloudId is used to correlate the SMO inventory record with the + deployed cloud instance. + displayName: CloudId + path: cloudId + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: DeploymentManagerServerConfig + path: deploymentManagerServerConfig + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: |- + Image is the full reference of the container image that contains the binary. This is + optional and the default will be the value passed to the `--image` command line flag of + the controller manager. + displayName: Image + path: image + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: IngressHost defines the FQDN for the IMS endpoints. + displayName: IngressHost + path: ingressHost + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: MetadataServerConfig + path: metadataServerConfig + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: ResourceServerConfig contains the configuration for the resource + server. + displayName: ResourceServerConfig + path: resourceServerConfig + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: BackendToken + path: resourceServerConfig.backendToken + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - displayName: BackendURL + path: resourceServerConfig.backendURL + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: This field allows the addition of extra O-Cloud information for + the resource server. + displayName: Extensions + path: resourceServerConfig.extensions + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + statusDescriptors: + - description: |- + INSERT ADDITIONAL STATUS FIELD - define observed state of cluster + Important: Run "make" to regenerate code after modifying this file + displayName: DeploymentsStatus + path: deploymentStatus + - displayName: Conditions + path: deploymentStatus.conditions + - displayName: DeploymentServerStatus + path: deploymentStatus.deploymentServerStatus + - displayName: MetadataServer tatus + path: deploymentStatus.metadataServerStatus + - displayName: ResourceServerStatus + path: deploymentStatus.resourceServerStatus + - displayName: DeploymentsStatus + path: usedServerConfig + version: v1alpha1 + - description: NodePool is the schema for an allocation request of nodes + displayName: ORAN O2IMS Cluster Request + kind: NodePool + name: nodepools.o2ims-hardwaremanagement.oran.openshift.io + resources: + - kind: Namespace + name: "" + version: v1 + specDescriptors: + - description: |- + 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. + displayName: CloudID + path: cloudID + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: Location + displayName: Location + path: location + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: Site + displayName: Site + path: site + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + version: v1alpha1 + - description: Node is the schema for an allocated node + displayName: ORAN O2IMS Cluster Request + kind: Node + name: nodes.o2ims-hardwaremanagement.oran.openshift.io + resources: + - kind: Namespace + name: "" + version: v1 + specDescriptors: + - description: GroupName + displayName: GroupName + path: groupName + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: HwProfile + displayName: HwProfile + path: hwProfile + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text + - description: NodePool + displayName: NodePool + path: nodePool + x-descriptors: + - urn:alm:descriptor:com.tectonic.ui:text version: v1alpha1 description: | # O-RAN O2IMS operator diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index aee28def..d2d436fd 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -135,7 +135,7 @@ rules: - apiGroups: - oran.openshift.io resources: - - clusterrequests + - Inventoryes verbs: - create - delete @@ -147,13 +147,13 @@ rules: - apiGroups: - oran.openshift.io resources: - - clusterrequests/finalizers + - Inventoryes/finalizers verbs: - update - apiGroups: - oran.openshift.io resources: - - clusterrequests/status + - Inventoryes/status verbs: - get - patch @@ -161,7 +161,7 @@ rules: - apiGroups: - oran.openshift.io resources: - - clustertemplates + - clusterrequests verbs: - create - delete @@ -173,13 +173,13 @@ rules: - apiGroups: - oran.openshift.io resources: - - clustertemplates/finalizers + - clusterrequests/finalizers verbs: - update - apiGroups: - oran.openshift.io resources: - - clustertemplates/status + - clusterrequests/status verbs: - get - patch @@ -187,7 +187,7 @@ rules: - apiGroups: - oran.openshift.io resources: - - orano2imses + - clustertemplates verbs: - create - delete @@ -199,13 +199,13 @@ rules: - apiGroups: - oran.openshift.io resources: - - orano2imses/finalizers + - clustertemplates/finalizers verbs: - update - apiGroups: - oran.openshift.io resources: - - orano2imses/status + - clustertemplates/status verbs: - get - patch diff --git a/config/samples/kustomization.yaml b/config/samples/kustomization.yaml index d702b40f..70d3e652 100644 --- a/config/samples/kustomization.yaml +++ b/config/samples/kustomization.yaml @@ -1,7 +1,7 @@ resources: # Inventory: -- v1alpha1_orano2ims.yaml +- v1alpha1_inventory.yaml # Hardware management: diff --git a/config/samples/v1alpha1_clusterrequest.yaml b/config/samples/v1alpha1_clusterrequest.yaml index 55ea1d2f..e35d5c52 100644 --- a/config/samples/v1alpha1_clusterrequest.yaml +++ b/config/samples/v1alpha1_clusterrequest.yaml @@ -1,4 +1,4 @@ -apiVersion: oran.openshift.io/v1alpha1 +apiVersion: o2ims.oran.openshift.io/v1alpha1 kind: ClusterRequest metadata: labels: diff --git a/config/samples/v1alpha1_clustertemplate.yaml b/config/samples/v1alpha1_clustertemplate.yaml index 23c3e863..cf824b61 100644 --- a/config/samples/v1alpha1_clustertemplate.yaml +++ b/config/samples/v1alpha1_clustertemplate.yaml @@ -1,4 +1,4 @@ -apiVersion: oran.openshift.io/v1alpha1 +apiVersion: o2ims.oran.openshift.io/v1alpha1 kind: ClusterTemplate metadata: labels: @@ -10,8 +10,24 @@ metadata: name: clustertemplate-sample spec: templates: - clusterInstanceDefaults: clustertemplate-sample-ci-defaults + clusterInstanceDefaults: clusterinstance-defaults-v1 + hwTemplate: hwtemplate-configmap-v1 + policyTemplateDefaults: policytemplate-defaults-v1 inputDataSchema: + policyTemplateSchema: + policyTemplateSchema: + description: policyTemplateSchema defines the available parameters for cluster configuration + properties: + sriov-network-vlan-1: + type: string + sriov-network-vlan-2: + type: string + sriov-network-pfNames-1: + type: string + sriov-network-pfNames-2: + type: string + cpu-isolated: + type: string clusterInstanceSchema: description: ClusterInstanceSpec defines the params that are allowed in the ClusterRequest spec.clusterInstanceInput properties: diff --git a/config/samples/v1alpha1_orano2ims.yaml b/config/samples/v1alpha1_inventory.yaml similarity index 69% rename from config/samples/v1alpha1_orano2ims.yaml rename to config/samples/v1alpha1_inventory.yaml index f3fac3a3..8d11d49b 100644 --- a/config/samples/v1alpha1_orano2ims.yaml +++ b/config/samples/v1alpha1_inventory.yaml @@ -1,9 +1,9 @@ -apiVersion: oran.openshift.io/v1alpha1 -kind: ORANO2IMS +apiVersion: o2ims.oran.openshift.io/v1alpha1 +kind: Inventory metadata: labels: - app.kubernetes.io/name: orano2ims - app.kubernetes.io/instance: orano2ims-sample + app.kubernetes.io/name: inventory + app.kubernetes.io/instance: inventory-sample app.kubernetes.io/part-of: oran-o2ims app.kubernetes.io/managed-by: kustomize app.kubernetes.io/created-by: oran-o2ims diff --git a/internal/controllers/clusterrequest_controller.go b/internal/controllers/clusterrequest_controller.go index 799aa92d..f1ec9d24 100644 --- a/internal/controllers/clusterrequest_controller.go +++ b/internal/controllers/clusterrequest_controller.go @@ -570,7 +570,7 @@ func (t *clusterRequestReconcilerTask) handleRenderHardwareTemplate(ctx context. } hwTemplateCmName := clusterTemplate.Spec.Templates.HwTemplate - hwTemplateCm, err := utils.GetConfigmap(ctx, t.client, hwTemplateCmName, utils.ORANO2IMSNamespace) + hwTemplateCm, err := utils.GetConfigmap(ctx, t.client, hwTemplateCmName, utils.InventoryNamespace) if err != nil { return nil, fmt.Errorf( "failed to get the %s configmap for Hardware Template, err: %w", hwTemplateCmName, err) @@ -1881,7 +1881,7 @@ func (r *ClusterRequestReconciler) handlePolicyEventUpdate( func (r *ClusterRequestReconciler) SetupWithManager(mgr ctrl.Manager) error { //nolint:wrapcheck return ctrl.NewControllerManagedBy(mgr). - Named("orano2ims-cluster-request"). + Named("Inventory-cluster-request"). For( &oranv1alpha1.ClusterRequest{}, // Watch for create and update event for ClusterRequest. diff --git a/internal/controllers/clusterrequest_controller_test.go b/internal/controllers/clusterrequest_controller_test.go index 19822e7d..328ebced 100644 --- a/internal/controllers/clusterrequest_controller_test.go +++ b/internal/controllers/clusterrequest_controller_test.go @@ -263,7 +263,7 @@ const ( "extra-label-key": "extra-label-value" }, "ManagedCluster": { - "cluster-version": "v4.16" + "cluster-version": "v4.17" } }, "ingressVIPs": [ @@ -744,7 +744,7 @@ var _ = Describe("renderHardwareTemplate", func() { cm := &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: hwTemplateCm, - Namespace: utils.ORANO2IMSNamespace, + Namespace: utils.InventoryNamespace, }, Data: map[string]string{ "hwMgrId": "hwmgr", @@ -1159,7 +1159,7 @@ defaultHugepagesSize: "1G"`, &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{ Name: hwTemplateCm, - Namespace: utils.ORANO2IMSNamespace, + Namespace: utils.InventoryNamespace, }, Data: map[string]string{ "hwMgrId": "hwmgr", diff --git a/internal/controllers/clustertemplate_controller.go b/internal/controllers/clustertemplate_controller.go index 4e6b609f..ad96532d 100644 --- a/internal/controllers/clustertemplate_controller.go +++ b/internal/controllers/clustertemplate_controller.go @@ -154,7 +154,7 @@ func (t *clusterTemplateReconcilerTask) validateClusterTemplateCR(ctx context.Co err := validateConfigmapReference[[]hwv1alpha1.NodeGroup]( ctx, t.client, t.object.Spec.Templates.HwTemplate, - utils.ORANO2IMSNamespace, + utils.InventoryNamespace, utils.HwTemplateNodePool) if err != nil { if !utils.IsInputError(err) { @@ -269,7 +269,7 @@ func (t *clusterTemplateReconcilerTask) updateStatusConditionValidated(ctx conte func (r *ClusterTemplateReconciler) initConfigmapClusterInstanceTemplate() (err error) { oranNs := corev1.Namespace{ ObjectMeta: metav1.ObjectMeta{ - Name: utils.ORANO2IMSNamespace, + Name: utils.InventoryNamespace, }, } err = r.Create(context.TODO(), &oranNs) @@ -329,7 +329,7 @@ func (r *ClusterTemplateReconciler) SetupWithManager(mgr ctrl.Manager) error { //nolint:wrapcheck return ctrl.NewControllerManagedBy(mgr). - Named("orano2ims-cluster-template"). + Named("Inventory-cluster-template"). For(&oranv1alpha1.ClusterTemplate{}, // Watch for create and update events for ClusterTemplate. builder.WithPredicates(predicate.Funcs{ @@ -387,7 +387,7 @@ func (r *ClusterTemplateReconciler) enqueueClusterTemplatesForConfigmap(ctx cont }, }) } - } else if obj.GetNamespace() == utils.ORANO2IMSNamespace { + } else if obj.GetNamespace() == utils.InventoryNamespace { if clusterTemplate.Spec.Templates.HwTemplate == obj.GetName() { requests = append(requests, reconcile.Request{ NamespacedName: types.NamespacedName{ diff --git a/internal/controllers/clustertemplate_controller_test.go b/internal/controllers/clustertemplate_controller_test.go index de2000a7..ebc7b1f8 100644 --- a/internal/controllers/clustertemplate_controller_test.go +++ b/internal/controllers/clustertemplate_controller_test.go @@ -86,7 +86,7 @@ clustertemplate-a-policy-v1-defaultHugepagesSize: "1G"`, { ObjectMeta: metav1.ObjectMeta{ Name: hwTemplateCm, - Namespace: utils.ORANO2IMSNamespace, + Namespace: utils.InventoryNamespace, }, Data: map[string]string{ utils.HwTemplateNodePool: ` @@ -313,7 +313,7 @@ clustertemplate-a-policy-v1-defaultHugepagesSize: "1G"`, { ObjectMeta: metav1.ObjectMeta{ Name: hwTemplateCm, - Namespace: utils.ORANO2IMSNamespace, + Namespace: utils.InventoryNamespace, }, Data: map[string]string{ utils.HwTemplateNodePool: ` diff --git a/internal/controllers/orano2ims_controller.go b/internal/controllers/inventory_controller.go similarity index 88% rename from internal/controllers/orano2ims_controller.go rename to internal/controllers/inventory_controller.go index 591826c8..f3a1ceac 100644 --- a/internal/controllers/orano2ims_controller.go +++ b/internal/controllers/inventory_controller.go @@ -44,9 +44,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/predicate" ) -//+kubebuilder:rbac:groups=oran.openshift.io,resources=orano2imses,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=oran.openshift.io,resources=orano2imses/status,verbs=get;update;patch -//+kubebuilder:rbac:groups=oran.openshift.io,resources=orano2imses/finalizers,verbs=update +//+kubebuilder:rbac:groups=oran.openshift.io,resources=Inventoryes,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=oran.openshift.io,resources=Inventoryes/status,verbs=get;update;patch +//+kubebuilder:rbac:groups=oran.openshift.io,resources=Inventoryes/finalizers,verbs=update //+kubebuilder:rbac:groups="apps",resources=deployments,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups="networking.k8s.io",resources=ingresses,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups="",resources=configmaps,verbs=get;list;watch;create;update;patch;delete @@ -59,7 +59,7 @@ import ( //+kubebuilder:rbac:groups="",resources=nodes,verbs=get;list;watch //+kubebuilder:rbac:groups="internal.open-cluster-management.io",resources=managedclusterinfos,verbs=get;list;watch -// Reconciler reconciles a ORANO2IMS object +// Reconciler reconciles a Inventory object type Reconciler struct { client.Client Logger *slog.Logger @@ -73,13 +73,13 @@ type reconcilerTask struct { logger *slog.Logger image string client client.Client - object *oranv1alpha1.ORANO2IMS + object *oranv1alpha1.Inventory } // Reconcile is part of the main kubernetes reconciliation loop which aims to // move the current state of the cluster closer to the desired state. // TODO(user): Modify the Reconcile function to compare the state specified by -// the ORANO2IMS object against the actual cluster state, and then +// the Inventory object against the actual cluster state, and then // perform operations to make the cluster state reflect the state specified by // the user. // @@ -88,7 +88,7 @@ type reconcilerTask struct { func (r *Reconciler) Reconcile(ctx context.Context, request ctrl.Request) (result ctrl.Result, err error) { // Fetch the object: - object := &oranv1alpha1.ORANO2IMS{} + object := &oranv1alpha1.Inventory{} if err := r.Client.Get(ctx, request.NamespacedName, object); err != nil { if errors.IsNotFound(err) { err = nil @@ -96,7 +96,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, request ctrl.Request) (resul } r.Logger.ErrorContext( ctx, - "Unable to fetch ORANO2IMS", + "Unable to fetch Inventory", slog.String("error", err.Error()), ) } @@ -116,7 +116,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, request ctrl.Request) (resul func (t *reconcilerTask) setupResourceServerConfig(ctx context.Context, defaultResult ctrl.Result) (nextReconcile ctrl.Result, err error) { nextReconcile = defaultResult - err = t.createServiceAccount(ctx, utils.ORANO2IMSResourceServerName) + err = t.createServiceAccount(ctx, utils.InventoryResourceServerName) if err != nil { t.logger.ErrorContext( ctx, @@ -147,7 +147,7 @@ func (t *reconcilerTask) setupResourceServerConfig(ctx context.Context, defaultR } // Create the Service needed for the Resource server. - err = t.createService(ctx, utils.ORANO2IMSResourceServerName) + err = t.createService(ctx, utils.InventoryResourceServerName) if err != nil { t.logger.ErrorContext( ctx, @@ -158,7 +158,7 @@ func (t *reconcilerTask) setupResourceServerConfig(ctx context.Context, defaultR } // Create the resource-server deployment. - errorReason, err := t.deployServer(ctx, utils.ORANO2IMSResourceServerName) + errorReason, err := t.deployServer(ctx, utils.InventoryResourceServerName) if err != nil { t.logger.ErrorContext( ctx, @@ -178,7 +178,7 @@ func (t *reconcilerTask) setupResourceServerConfig(ctx context.Context, defaultR func (t *reconcilerTask) setupMetadataServerConfig(ctx context.Context, defaultResult ctrl.Result) (nextReconcile ctrl.Result, err error) { nextReconcile = defaultResult - err = t.createServiceAccount(ctx, utils.ORANO2IMSMetadataServerName) + err = t.createServiceAccount(ctx, utils.InventoryMetadataServerName) if err != nil { t.logger.ErrorContext( ctx, @@ -189,7 +189,7 @@ func (t *reconcilerTask) setupMetadataServerConfig(ctx context.Context, defaultR } // Create the Service needed for the Metadata server. - err = t.createService(ctx, utils.ORANO2IMSMetadataServerName) + err = t.createService(ctx, utils.InventoryMetadataServerName) if err != nil { t.logger.ErrorContext( ctx, @@ -200,7 +200,7 @@ func (t *reconcilerTask) setupMetadataServerConfig(ctx context.Context, defaultR } // Create the metadata-server deployment. - errorReason, err := t.deployServer(ctx, utils.ORANO2IMSMetadataServerName) + errorReason, err := t.deployServer(ctx, utils.InventoryMetadataServerName) if err != nil { t.logger.ErrorContext( ctx, @@ -220,7 +220,7 @@ func (t *reconcilerTask) setupMetadataServerConfig(ctx context.Context, defaultR func (t *reconcilerTask) setupDeploymentManagerServerConfig(ctx context.Context, defaultResult ctrl.Result) (nextReconcile ctrl.Result, err error) { nextReconcile = defaultResult - err = t.createServiceAccount(ctx, utils.ORANO2IMSDeploymentManagerServerName) + err = t.createServiceAccount(ctx, utils.InventoryDeploymentManagerServerName) if err != nil { t.logger.ErrorContext( ctx, @@ -249,7 +249,7 @@ func (t *reconcilerTask) setupDeploymentManagerServerConfig(ctx context.Context, } // Create authz ConfigMap. - err = t.createConfigMap(ctx, utils.ORANO2IMSConfigMapName) + err = t.createConfigMap(ctx, utils.InventoryConfigMapName) if err != nil { t.logger.ErrorContext( ctx, @@ -260,7 +260,7 @@ func (t *reconcilerTask) setupDeploymentManagerServerConfig(ctx context.Context, } // Create the Service needed for the Deployment Manager server. - err = t.createService(ctx, utils.ORANO2IMSDeploymentManagerServerName) + err = t.createService(ctx, utils.InventoryDeploymentManagerServerName) if err != nil { t.logger.ErrorContext( ctx, @@ -271,7 +271,7 @@ func (t *reconcilerTask) setupDeploymentManagerServerConfig(ctx context.Context, } // Create the deployment-manager-server deployment. - errorReason, err := t.deployServer(ctx, utils.ORANO2IMSDeploymentManagerServerName) + errorReason, err := t.deployServer(ctx, utils.InventoryDeploymentManagerServerName) if err != nil { t.logger.ErrorContext( ctx, @@ -291,7 +291,7 @@ func (t *reconcilerTask) setupDeploymentManagerServerConfig(ctx context.Context, func (t *reconcilerTask) setupAlarmSubscriptionServerConfig(ctx context.Context, defaultResult ctrl.Result) (nextReconcile ctrl.Result, err error) { nextReconcile = defaultResult - err = t.createConfigMap(ctx, utils.ORANO2IMSConfigMapName) + err = t.createConfigMap(ctx, utils.InventoryConfigMapName) if err != nil { t.logger.ErrorContext( ctx, @@ -302,7 +302,7 @@ func (t *reconcilerTask) setupAlarmSubscriptionServerConfig(ctx context.Context, } // Create the needed ServiceAccount. - err = t.createServiceAccount(ctx, utils.ORANO2IMSAlarmSubscriptionServerName) + err = t.createServiceAccount(ctx, utils.InventoryAlarmSubscriptionServerName) if err != nil { t.logger.ErrorContext( ctx, @@ -313,7 +313,7 @@ func (t *reconcilerTask) setupAlarmSubscriptionServerConfig(ctx context.Context, } // Create the Service needed for the alarm subscription server. - err = t.createService(ctx, utils.ORANO2IMSAlarmSubscriptionServerName) + err = t.createService(ctx, utils.InventoryAlarmSubscriptionServerName) if err != nil { t.logger.ErrorContext( ctx, @@ -324,7 +324,7 @@ func (t *reconcilerTask) setupAlarmSubscriptionServerConfig(ctx context.Context, } // Create the alarm subscription-server deployment. - errorReason, err := t.deployServer(ctx, utils.ORANO2IMSAlarmSubscriptionServerName) + errorReason, err := t.deployServer(ctx, utils.InventoryAlarmSubscriptionServerName) if err != nil { t.logger.ErrorContext( ctx, @@ -359,7 +359,7 @@ func (t *reconcilerTask) run(ctx context.Context) (nextReconcile ctrl.Result, er } // Create the client service account. - err = t.createServiceAccount(ctx, utils.ORANO2IMSClientSAName) + err = t.createServiceAccount(ctx, utils.InventoryClientSAName) if err != nil { t.logger.ErrorContext( ctx, @@ -410,7 +410,7 @@ func (t *reconcilerTask) run(ctx context.Context) (nextReconcile ctrl.Result, er if err != nil { t.logger.ErrorContext( ctx, - "Failed to update status for ORANO2IMS", + "Failed to update status for Inventory", slog.String("name", t.object.Name), ) nextReconcile = ctrl.Result{RequeueAfter: 30 * time.Second} @@ -422,7 +422,7 @@ func (t *reconcilerTask) createDeploymentManagerClusterRole(ctx context.Context) role := &rbacv1.ClusterRole{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf( - "%s-%s", t.object.Namespace, utils.ORANO2IMSDeploymentManagerServerName, + "%s-%s", t.object.Namespace, utils.InventoryDeploymentManagerServerName, ), }, Rules: []rbacv1.PolicyRule{ @@ -472,7 +472,7 @@ func (t *reconcilerTask) createDeploymentManagerClusterRoleBinding(ctx context.C ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf( "%s-%s", - t.object.Namespace, utils.ORANO2IMSDeploymentManagerServerName, + t.object.Namespace, utils.InventoryDeploymentManagerServerName, ), }, RoleRef: rbacv1.RoleRef{ @@ -480,14 +480,14 @@ func (t *reconcilerTask) createDeploymentManagerClusterRoleBinding(ctx context.C Kind: "ClusterRole", Name: fmt.Sprintf( "%s-%s", - t.object.Namespace, utils.ORANO2IMSDeploymentManagerServerName, + t.object.Namespace, utils.InventoryDeploymentManagerServerName, ), }, Subjects: []rbacv1.Subject{ { Kind: rbacv1.ServiceAccountKind, Namespace: t.object.Namespace, - Name: utils.ORANO2IMSDeploymentManagerServerName, + Name: utils.InventoryDeploymentManagerServerName, }, }, } @@ -503,7 +503,7 @@ func (t *reconcilerTask) createResourceServerClusterRole(ctx context.Context) er role := &rbacv1.ClusterRole{ ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf( - "%s-%s", t.object.Namespace, utils.ORANO2IMSResourceServerName, + "%s-%s", t.object.Namespace, utils.InventoryResourceServerName, ), }, Rules: []rbacv1.PolicyRule{ @@ -563,7 +563,7 @@ func (t *reconcilerTask) createResourceServerClusterRoleBinding(ctx context.Cont ObjectMeta: metav1.ObjectMeta{ Name: fmt.Sprintf( "%s-%s", - t.object.Namespace, utils.ORANO2IMSResourceServerName, + t.object.Namespace, utils.InventoryResourceServerName, ), }, RoleRef: rbacv1.RoleRef{ @@ -571,14 +571,14 @@ func (t *reconcilerTask) createResourceServerClusterRoleBinding(ctx context.Cont Kind: "ClusterRole", Name: fmt.Sprintf( "%s-%s", - t.object.Namespace, utils.ORANO2IMSResourceServerName, + t.object.Namespace, utils.InventoryResourceServerName, ), }, Subjects: []rbacv1.Subject{ { Kind: rbacv1.ServiceAccountKind, Namespace: t.object.Namespace, - Name: utils.ORANO2IMSResourceServerName, + Name: utils.InventoryResourceServerName, }, }, } @@ -590,7 +590,7 @@ func (t *reconcilerTask) createResourceServerClusterRoleBinding(ctx context.Cont return nil } -func (t *reconcilerTask) deployServer(ctx context.Context, serverName string) (utils.ORANO2IMSConditionReason, error) { +func (t *reconcilerTask) deployServer(ctx context.Context, serverName string) (utils.InventoryConditionReason, error) { t.logger.InfoContext(ctx, "[deploy server]", "Name", serverName) // Server variables. @@ -600,7 +600,7 @@ func (t *reconcilerTask) deployServer(ctx context.Context, serverName string) (u // Build the deployment's metadata. deploymentMeta := metav1.ObjectMeta{ Name: serverName, - Namespace: utils.ORANO2IMSNamespace, + Namespace: utils.InventoryNamespace, Labels: map[string]string{ "oran/o2ims": t.object.Name, "app": serverName, @@ -611,11 +611,11 @@ func (t *reconcilerTask) deployServer(ctx context.Context, serverName string) (u if err != nil { err2 := t.updateORANO2ISMUsedConfigStatus( ctx, serverName, deploymentContainerArgs, - utils.ORANO2IMSConditionReasons.ServerArgumentsError, err) + utils.InventoryConditionReasons.ServerArgumentsError, err) if err2 != nil { return "", fmt.Errorf("failed to update ORANO2ISMUsedConfigStatus: %w", err2) } - return utils.ORANO2IMSConditionReasons.ServerArgumentsError, fmt.Errorf("failed to get server arguments: %w", err) + return utils.InventoryConditionReasons.ServerArgumentsError, fmt.Errorf("failed to get server arguments: %w", err) } err = t.updateORANO2ISMUsedConfigStatus(ctx, serverName, deploymentContainerArgs, "", nil) if err != nil { @@ -690,7 +690,7 @@ func (t *reconcilerTask) createConfigMap(ctx context.Context, resourceName strin Namespace: t.object.Namespace, }, Data: map[string]string{ - "acl.yaml": fmt.Sprintf("- claim: sub\n pattern: ^system:serviceaccount:%s:client$", utils.ORANO2IMSNamespace), + "acl.yaml": fmt.Sprintf("- claim: sub\n pattern: ^system:serviceaccount:%s:client$", utils.InventoryNamespace), }, } @@ -710,7 +710,7 @@ func (t *reconcilerTask) createServiceAccount(ctx context.Context, resourceName Namespace: t.object.Namespace, } - if resourceName != utils.ORANO2IMSClientSAName { + if resourceName != utils.InventoryClientSAName { serviceAccountMeta.Annotations = map[string]string{ "service.beta.openshift.io/serving-cert-secret-name": fmt.Sprintf("%s-tls", resourceName), } @@ -772,7 +772,7 @@ func (t *reconcilerTask) createIngress(ctx context.Context) error { t.logger.InfoContext(ctx, "[createIngress]") // Build the Ingress object. ingressMeta := metav1.ObjectMeta{ - Name: utils.ORANO2IMSIngressName, + Name: utils.InventoryIngressName, Namespace: t.object.Namespace, Annotations: map[string]string{ "route.openshift.io/termination": "reencrypt", @@ -796,7 +796,7 @@ func (t *reconcilerTask) createIngress(ctx context.Context) error { Service: &networkingv1.IngressServiceBackend{ Name: "resource-server", Port: networkingv1.ServiceBackendPort{ - Name: utils.ORANO2IMSIngressName, + Name: utils.InventoryIngressName, }, }, }, @@ -811,7 +811,7 @@ func (t *reconcilerTask) createIngress(ctx context.Context) error { Service: &networkingv1.IngressServiceBackend{ Name: "resource-server", Port: networkingv1.ServiceBackendPort{ - Name: utils.ORANO2IMSIngressName, + Name: utils.InventoryIngressName, }, }, }, @@ -826,7 +826,7 @@ func (t *reconcilerTask) createIngress(ctx context.Context) error { Service: &networkingv1.IngressServiceBackend{ Name: "deployment-manager-server", Port: networkingv1.ServiceBackendPort{ - Name: utils.ORANO2IMSIngressName, + Name: utils.InventoryIngressName, }, }, }, @@ -841,7 +841,7 @@ func (t *reconcilerTask) createIngress(ctx context.Context) error { Service: &networkingv1.IngressServiceBackend{ Name: "metadata-server", Port: networkingv1.ServiceBackendPort{ - Name: utils.ORANO2IMSIngressName, + Name: utils.InventoryIngressName, }, }, }, @@ -856,7 +856,7 @@ func (t *reconcilerTask) createIngress(ctx context.Context) error { Service: &networkingv1.IngressServiceBackend{ Name: "alarm-subscription-server", Port: networkingv1.ServiceBackendPort{ - Name: utils.ORANO2IMSIngressName, + Name: utils.InventoryIngressName, }, }, }, @@ -873,7 +873,7 @@ func (t *reconcilerTask) createIngress(ctx context.Context) error { Spec: ingressSpec, } - t.logger.InfoContext(ctx, "[createIngress] Create/Update/Patch Ingress: ", "name", utils.ORANO2IMSIngressName) + t.logger.InfoContext(ctx, "[createIngress] Create/Update/Patch Ingress: ", "name", utils.InventoryIngressName) if err := utils.CreateK8sCR(ctx, t.client, newIngress, t.object, utils.UPDATE); err != nil { return fmt.Errorf("failed to create Ingress for deployment: %w", err) } @@ -883,17 +883,17 @@ func (t *reconcilerTask) createIngress(ctx context.Context) error { func (t *reconcilerTask) updateORANO2ISMStatusConditions(ctx context.Context, deploymentName string) { deployment := &appsv1.Deployment{} - err := t.client.Get(ctx, types.NamespacedName{Name: deploymentName, Namespace: utils.ORANO2IMSNamespace}, deployment) + err := t.client.Get(ctx, types.NamespacedName{Name: deploymentName, Namespace: utils.InventoryNamespace}, deployment) if err != nil { - reason := string(utils.ORANO2IMSConditionReasons.ErrorGettingDeploymentInformation) + reason := string(utils.InventoryConditionReasons.ErrorGettingDeploymentInformation) if errors.IsNotFound(err) { - reason = string(utils.ORANO2IMSConditionReasons.DeploymentNotFound) + reason = string(utils.InventoryConditionReasons.DeploymentNotFound) } meta.SetStatusCondition( &t.object.Status.DeploymentsStatus.Conditions, metav1.Condition{ - Type: string(utils.ORANO2IMSConditionTypes.Error), + Type: string(utils.InventoryConditionTypes.Error), Status: metav1.ConditionTrue, Reason: reason, Message: fmt.Sprintf("Error when querying for the %s server", deploymentName), @@ -903,19 +903,19 @@ func (t *reconcilerTask) updateORANO2ISMStatusConditions(ctx context.Context, de meta.SetStatusCondition( &t.object.Status.DeploymentsStatus.Conditions, metav1.Condition{ - Type: string(utils.ORANO2IMSConditionTypes.Ready), + Type: string(utils.InventoryConditionTypes.Ready), Status: metav1.ConditionFalse, - Reason: string(utils.ORANO2IMSConditionReasons.DeploymentsReady), + Reason: string(utils.InventoryConditionReasons.DeploymentsReady), Message: "The ORAN O2IMS Deployments are not yet ready", }, ) } else { meta.RemoveStatusCondition( &t.object.Status.DeploymentsStatus.Conditions, - string(utils.ORANO2IMSConditionTypes.Error)) + string(utils.InventoryConditionTypes.Error)) meta.RemoveStatusCondition( &t.object.Status.DeploymentsStatus.Conditions, - string(utils.ORANO2IMSConditionTypes.Ready)) + string(utils.InventoryConditionTypes.Ready)) for _, condition := range deployment.Status.Conditions { // Obtain the status directly from the Deployment resources. if condition.Type == "Available" { @@ -935,18 +935,18 @@ func (t *reconcilerTask) updateORANO2ISMStatusConditions(ctx context.Context, de func (t *reconcilerTask) updateORANO2ISMUsedConfigStatus( ctx context.Context, serverName string, deploymentArgs []string, - errorReason utils.ORANO2IMSConditionReason, err error) error { + errorReason utils.InventoryConditionReason, err error) error { t.logger.InfoContext(ctx, "[updateORANO2ISMUsedConfigStatus]") - if serverName == utils.ORANO2IMSMetadataServerName { + if serverName == utils.InventoryMetadataServerName { t.object.Status.UsedServerConfig.MetadataServerUsedConfig = deploymentArgs } - if serverName == utils.ORANO2IMSDeploymentManagerServerName { + if serverName == utils.InventoryDeploymentManagerServerName { t.object.Status.UsedServerConfig.DeploymentManagerServerUsedConfig = deploymentArgs } - if serverName == utils.ORANO2IMSResourceServerName { + if serverName == utils.InventoryResourceServerName { t.object.Status.UsedServerConfig.ResourceServerUsedConfig = deploymentArgs } @@ -982,15 +982,15 @@ func (t *reconcilerTask) updateORANO2ISMDeploymentStatus(ctx context.Context) er t.logger.InfoContext(ctx, "[updateORANO2ISMDeploymentStatus]") if t.object.Spec.MetadataServerConfig.Enabled { - t.updateORANO2ISMStatusConditions(ctx, utils.ORANO2IMSMetadataServerName) + t.updateORANO2ISMStatusConditions(ctx, utils.InventoryMetadataServerName) } if t.object.Spec.DeploymentManagerServerConfig.Enabled { - t.updateORANO2ISMStatusConditions(ctx, utils.ORANO2IMSDeploymentManagerServerName) + t.updateORANO2ISMStatusConditions(ctx, utils.InventoryDeploymentManagerServerName) } if t.object.Spec.ResourceServerConfig.Enabled { - t.updateORANO2ISMStatusConditions(ctx, utils.ORANO2IMSResourceServerName) + t.updateORANO2ISMStatusConditions(ctx, utils.InventoryResourceServerName) } if err := utils.UpdateK8sCRStatus(ctx, t.client, t.object); err != nil { @@ -1005,16 +1005,16 @@ func (r *Reconciler) SetupWithManager(mgr ctrl.Manager) error { //nolint:wrapcheck return ctrl.NewControllerManagedBy(mgr). - Named("orano2ims"). - For(&oranv1alpha1.ORANO2IMS{}, - // Watch for create event for orano2ims. + Named("Inventory"). + For(&oranv1alpha1.Inventory{}, + // Watch for create event for Inventory. builder.WithPredicates(predicate.Funcs{ UpdateFunc: func(e event.UpdateEvent) bool { // Generation is only updated on spec changes (also on deletion), // not metadata or status. oldGeneration := e.ObjectOld.GetGeneration() newGeneration := e.ObjectNew.GetGeneration() - // spec update only for orano2ims + // spec update only for Inventory return oldGeneration != newGeneration }, CreateFunc: func(e event.CreateEvent) bool { return true }, diff --git a/internal/controllers/orano2ims_controller_test.go b/internal/controllers/inventory_controller_test.go similarity index 83% rename from internal/controllers/orano2ims_controller_test.go rename to internal/controllers/inventory_controller_test.go index 723ec46b..4a566c60 100644 --- a/internal/controllers/orano2ims_controller_test.go +++ b/internal/controllers/inventory_controller_test.go @@ -72,13 +72,13 @@ var _ = DescribeTable( Entry( "Metadata server deployment is updated after edit", []client.Object{ - &oranv1alpha1.ORANO2IMS{ + &oranv1alpha1.Inventory{ ObjectMeta: metav1.ObjectMeta{ Name: "oran-o2ims-sample-1", - Namespace: utils.ORANO2IMSNamespace, + Namespace: utils.InventoryNamespace, CreationTimestamp: metav1.Now(), }, - Spec: oranv1alpha1.ORANO2IMSSpec{ + Spec: oranv1alpha1.InventorySpec{ MetadataServerConfig: oranv1alpha1.MetadataServerConfig{ ServerConfig: oranv1alpha1.ServerConfig{ Enabled: true, @@ -94,7 +94,7 @@ var _ = DescribeTable( }, reconcile.Request{ NamespacedName: types.NamespacedName{ - Namespace: utils.ORANO2IMSNamespace, + Namespace: utils.InventoryNamespace, Name: "oran-o2ims-sample-1", }, }, @@ -106,8 +106,8 @@ var _ = DescribeTable( err := reconciler.Client.Get( context.TODO(), types.NamespacedName{ - Name: utils.ORANO2IMSMetadataServerName, - Namespace: utils.ORANO2IMSNamespace, + Name: utils.InventoryMetadataServerName, + Namespace: utils.InventoryNamespace, }, metadataDeployment) Expect(err).ToNot(HaveOccurred()) @@ -121,7 +121,7 @@ var _ = DescribeTable( // Run the reconciliation again. req := reconcile.Request{ NamespacedName: types.NamespacedName{ - Namespace: utils.ORANO2IMSNamespace, + Namespace: utils.InventoryNamespace, Name: "oran-o2ims-sample-1", }, } @@ -132,8 +132,8 @@ var _ = DescribeTable( err = reconciler.Client.Get( context.TODO(), types.NamespacedName{ - Name: utils.ORANO2IMSMetadataServerName, - Namespace: utils.ORANO2IMSNamespace, + Name: utils.InventoryMetadataServerName, + Namespace: utils.InventoryNamespace, }, metadataDeployment) Expect(err).ToNot(HaveOccurred()) @@ -144,13 +144,13 @@ var _ = DescribeTable( Entry( "Only the metadata server is required", []client.Object{ - &oranv1alpha1.ORANO2IMS{ + &oranv1alpha1.Inventory{ ObjectMeta: metav1.ObjectMeta{ Name: "oran-o2ims-sample-1", - Namespace: utils.ORANO2IMSNamespace, + Namespace: utils.InventoryNamespace, CreationTimestamp: metav1.Now(), }, - Spec: oranv1alpha1.ORANO2IMSSpec{ + Spec: oranv1alpha1.InventorySpec{ MetadataServerConfig: oranv1alpha1.MetadataServerConfig{ ServerConfig: oranv1alpha1.ServerConfig{ Enabled: true, @@ -166,7 +166,7 @@ var _ = DescribeTable( }, reconcile.Request{ NamespacedName: types.NamespacedName{ - Namespace: utils.ORANO2IMSNamespace, + Namespace: utils.InventoryNamespace, Name: "oran-o2ims-sample-1", }, }, @@ -178,8 +178,8 @@ var _ = DescribeTable( err := reconciler.Client.Get( context.TODO(), types.NamespacedName{ - Name: utils.ORANO2IMSMetadataServerName, - Namespace: utils.ORANO2IMSNamespace, + Name: utils.InventoryMetadataServerName, + Namespace: utils.InventoryNamespace, }, metadataDeployment) Expect(err).ToNot(HaveOccurred()) @@ -189,8 +189,8 @@ var _ = DescribeTable( err = reconciler.Client.Get( context.TODO(), types.NamespacedName{ - Name: utils.ORANO2IMSIngressName, - Namespace: utils.ORANO2IMSNamespace, + Name: utils.InventoryIngressName, + Namespace: utils.InventoryNamespace, }, ingress) Expect(err).ToNot(HaveOccurred()) @@ -200,8 +200,8 @@ var _ = DescribeTable( err = reconciler.Client.Get( context.TODO(), types.NamespacedName{ - Name: utils.ORANO2IMSMetadataServerName, - Namespace: utils.ORANO2IMSNamespace, + Name: utils.InventoryMetadataServerName, + Namespace: utils.InventoryNamespace, }, serviceAccount) Expect(err).ToNot(HaveOccurred()) @@ -211,8 +211,8 @@ var _ = DescribeTable( err = reconciler.Client.Get( context.TODO(), types.NamespacedName{ - Name: utils.ORANO2IMSMetadataServerName, - Namespace: utils.ORANO2IMSNamespace, + Name: utils.InventoryMetadataServerName, + Namespace: utils.InventoryNamespace, }, service) Expect(err).ToNot(HaveOccurred()) @@ -222,24 +222,24 @@ var _ = DescribeTable( err = reconciler.Client.Get( context.TODO(), types.NamespacedName{ - Name: utils.ORANO2IMSDeploymentManagerServerName, - Namespace: utils.ORANO2IMSNamespace, + Name: utils.InventoryDeploymentManagerServerName, + Namespace: utils.InventoryNamespace, }, deploymentManagerDeployment) Expect(err).To(HaveOccurred()) - Expect(err).To(MatchError(fmt.Sprintf("deployments.apps \"%s\" not found", utils.ORANO2IMSDeploymentManagerServerName))) + Expect(err).To(MatchError(fmt.Sprintf("deployments.apps \"%s\" not found", utils.InventoryDeploymentManagerServerName))) }, ), Entry( "Metadata and deployment manager servers required", []client.Object{ - &oranv1alpha1.ORANO2IMS{ + &oranv1alpha1.Inventory{ ObjectMeta: metav1.ObjectMeta{ Name: "oran-o2ims-sample-1", Namespace: "oran-o2ims", CreationTimestamp: metav1.Now(), }, - Spec: oranv1alpha1.ORANO2IMSSpec{ + Spec: oranv1alpha1.InventorySpec{ MetadataServerConfig: oranv1alpha1.MetadataServerConfig{ ServerConfig: oranv1alpha1.ServerConfig{ Enabled: true, @@ -255,7 +255,7 @@ var _ = DescribeTable( }, reconcile.Request{ NamespacedName: types.NamespacedName{ - Namespace: utils.ORANO2IMSNamespace, + Namespace: utils.InventoryNamespace, Name: "oran-o2ims-sample-1", }, }, @@ -267,8 +267,8 @@ var _ = DescribeTable( err := reconciler.Client.Get( context.TODO(), types.NamespacedName{ - Name: utils.ORANO2IMSMetadataServerName, - Namespace: utils.ORANO2IMSNamespace, + Name: utils.InventoryMetadataServerName, + Namespace: utils.InventoryNamespace, }, metadataDeployment) Expect(err).ToNot(HaveOccurred()) @@ -278,8 +278,8 @@ var _ = DescribeTable( err = reconciler.Client.Get( context.TODO(), types.NamespacedName{ - Name: utils.ORANO2IMSDeploymentManagerServerName, - Namespace: utils.ORANO2IMSNamespace, + Name: utils.InventoryDeploymentManagerServerName, + Namespace: utils.InventoryNamespace, }, deploymentManagerDeployment) Expect(err).ToNot(HaveOccurred()) @@ -288,13 +288,13 @@ var _ = DescribeTable( Entry( "No O-RAN O2IMS server required", []client.Object{ - &oranv1alpha1.ORANO2IMS{ + &oranv1alpha1.Inventory{ ObjectMeta: metav1.ObjectMeta{ Name: "oran-o2ims-sample-1", Namespace: "oran-o2ims", CreationTimestamp: metav1.Now(), }, - Spec: oranv1alpha1.ORANO2IMSSpec{ + Spec: oranv1alpha1.InventorySpec{ MetadataServerConfig: oranv1alpha1.MetadataServerConfig{ ServerConfig: oranv1alpha1.ServerConfig{ Enabled: false, @@ -310,7 +310,7 @@ var _ = DescribeTable( }, reconcile.Request{ NamespacedName: types.NamespacedName{ - Namespace: utils.ORANO2IMSNamespace, + Namespace: utils.InventoryNamespace, Name: "oran-o2ims-sample-1", }, }, @@ -321,24 +321,24 @@ var _ = DescribeTable( err := reconciler.Client.Get( context.TODO(), types.NamespacedName{ - Name: utils.ORANO2IMSMetadataServerName, - Namespace: utils.ORANO2IMSNamespace, + Name: utils.InventoryMetadataServerName, + Namespace: utils.InventoryNamespace, }, metadataDeployment) Expect(err).To(HaveOccurred()) - Expect(err).To(MatchError(fmt.Sprintf("deployments.apps \"%s\" not found", utils.ORANO2IMSMetadataServerName))) + Expect(err).To(MatchError(fmt.Sprintf("deployments.apps \"%s\" not found", utils.InventoryMetadataServerName))) // Check the deployment manager server does not exist. deploymentManagerDeployment := &appsv1.Deployment{} err = reconciler.Client.Get( context.TODO(), types.NamespacedName{ - Name: utils.ORANO2IMSDeploymentManagerServerName, - Namespace: utils.ORANO2IMSNamespace, + Name: utils.InventoryDeploymentManagerServerName, + Namespace: utils.InventoryNamespace, }, deploymentManagerDeployment) Expect(err).To(HaveOccurred()) - Expect(err).To(MatchError(fmt.Sprintf("deployments.apps \"%s\" not found", utils.ORANO2IMSDeploymentManagerServerName))) + Expect(err).To(MatchError(fmt.Sprintf("deployments.apps \"%s\" not found", utils.InventoryDeploymentManagerServerName))) }, ), ) diff --git a/internal/controllers/suite_test.go b/internal/controllers/suite_test.go index 105d7417..759e1790 100644 --- a/internal/controllers/suite_test.go +++ b/internal/controllers/suite_test.go @@ -45,7 +45,7 @@ func getFakeClientFromObjects(objs ...client.Object) client.WithWatch { return fake.NewClientBuilder(). WithScheme(scheme). WithObjects(objs...). - WithStatusSubresource(&oranv1alpha1.ORANO2IMS{}). + WithStatusSubresource(&oranv1alpha1.Inventory{}). WithStatusSubresource(&oranv1alpha1.ClusterTemplate{}). WithStatusSubresource(&oranv1alpha1.ClusterRequest{}). WithStatusSubresource(&siteconfig.ClusterInstance{}). @@ -76,8 +76,8 @@ var _ = BeforeSuite(func() { klog.SetLogger(adapter) // Add all the required types to the scheme used by the tests: - scheme.AddKnownTypes(oranv1alpha1.GroupVersion, &oranv1alpha1.ORANO2IMS{}) - scheme.AddKnownTypes(oranv1alpha1.GroupVersion, &oranv1alpha1.ORANO2IMSList{}) + scheme.AddKnownTypes(oranv1alpha1.GroupVersion, &oranv1alpha1.Inventory{}) + scheme.AddKnownTypes(oranv1alpha1.GroupVersion, &oranv1alpha1.InventoryList{}) scheme.AddKnownTypes(oranv1alpha1.GroupVersion, &oranv1alpha1.ClusterTemplate{}) scheme.AddKnownTypes(oranv1alpha1.GroupVersion, &oranv1alpha1.ClusterTemplateList{}) scheme.AddKnownTypes(oranv1alpha1.GroupVersion, &oranv1alpha1.ClusterRequest{}) diff --git a/internal/controllers/utils/constants.go b/internal/controllers/utils/constants.go index a69013c9..0ec4f543 100644 --- a/internal/controllers/utils/constants.go +++ b/internal/controllers/utils/constants.go @@ -2,16 +2,16 @@ package utils // Default namespace const ( - ORANO2IMSNamespace = "oran-o2ims" + InventoryNamespace = "oran-o2ims" ) // Base resource names const ( - ORANO2IMSMetadata = "metadata" - ORANO2IMSDeploymentManager = "deployment-manager" - ORANO2IMSResource = "resource" - ORANO2IMSAlarmSubscription = "alarm-subscription" - ORANO2IMSAlarmNotification = "alarm-notification" + InventoryMetadata = "metadata" + InventoryDeploymentManager = "deployment-manager" + InventoryResource = "resource" + InventoryAlarmSubscription = "alarm-subscription" + InventoryAlarmNotification = "alarm-notification" ) // Suffix for server names @@ -19,18 +19,18 @@ const serverSuffix = "-server" // Deployment names const ( - ORANO2IMSMetadataServerName = ORANO2IMSMetadata + serverSuffix - ORANO2IMSDeploymentManagerServerName = ORANO2IMSDeploymentManager + serverSuffix - ORANO2IMSResourceServerName = ORANO2IMSResource + serverSuffix - ORANO2IMSAlarmSubscriptionServerName = ORANO2IMSAlarmSubscription + serverSuffix - ORANO2IMSAlarmNotificationServerName = ORANO2IMSAlarmNotification + serverSuffix + InventoryMetadataServerName = InventoryMetadata + serverSuffix + InventoryDeploymentManagerServerName = InventoryDeploymentManager + serverSuffix + InventoryResourceServerName = InventoryResource + serverSuffix + InventoryAlarmSubscriptionServerName = InventoryAlarmSubscription + serverSuffix + InventoryAlarmNotificationServerName = InventoryAlarmNotification + serverSuffix ) // CR default names const ( - ORANO2IMSIngressName = "api" - ORANO2IMSConfigMapName = "authz" - ORANO2IMSClientSAName = "client" + InventoryIngressName = "api" + InventoryConfigMapName = "authz" + InventoryClientSAName = "client" ) // Resource operations @@ -87,7 +87,7 @@ const ( ClusterInstanceTemplateName = "ClusterInstance" ClusterInstanceTemplatePath = "controllers/clusterinstance-template.yaml" ClusterInstanceTemplateConfigmapName = "sc-clusterinstance-template" - ClusterInstanceTemplateConfigmapNamespace = ORANO2IMSNamespace + ClusterInstanceTemplateConfigmapNamespace = InventoryNamespace ClusterInstanceTemplateDefaultsConfigmapKey = "clusterinstance-defaults" ClusterInstanceSchema = "clusterInstanceSchema" ) diff --git a/internal/controllers/utils/types.go b/internal/controllers/utils/types.go index 01ca842b..15d5093a 100644 --- a/internal/controllers/utils/types.go +++ b/internal/controllers/utils/types.go @@ -1,22 +1,22 @@ package utils -// ORANO2IMSConditionType defines conditions of an ORANO2IMS deployment. -type ORANO2IMSConditionType string +// InventoryConditionType defines conditions of an Inventory deployment. +type InventoryConditionType string -var ORANO2IMSConditionTypes = struct { - Ready ORANO2IMSConditionType - NotReady ORANO2IMSConditionType - Error ORANO2IMSConditionType - Available ORANO2IMSConditionType - MetadataServerAvailable ORANO2IMSConditionType - DeploymentServerAvailable ORANO2IMSConditionType - ResourceServerAvailable ORANO2IMSConditionType - MetadataServerError ORANO2IMSConditionType - DeploymentServerError ORANO2IMSConditionType - ResourceServerError ORANO2IMSConditionType +var InventoryConditionTypes = struct { + Ready InventoryConditionType + NotReady InventoryConditionType + Error InventoryConditionType + Available InventoryConditionType + MetadataServerAvailable InventoryConditionType + DeploymentServerAvailable InventoryConditionType + ResourceServerAvailable InventoryConditionType + MetadataServerError InventoryConditionType + DeploymentServerError InventoryConditionType + ResourceServerError InventoryConditionType }{ - Ready: "ORANO2IMSReady", - NotReady: "ORANO2IMSConditionType", + Ready: "InventoryReady", + NotReady: "InventoryConditionType", Error: "Error", Available: "Available", MetadataServerAvailable: "MetadataServerAvailable", @@ -27,13 +27,13 @@ var ORANO2IMSConditionTypes = struct { ResourceServerError: "ResourceServerError", } -type ORANO2IMSConditionReason string +type InventoryConditionReason string -var ORANO2IMSConditionReasons = struct { - DeploymentsReady ORANO2IMSConditionReason - ErrorGettingDeploymentInformation ORANO2IMSConditionReason - DeploymentNotFound ORANO2IMSConditionReason - ServerArgumentsError ORANO2IMSConditionReason +var InventoryConditionReasons = struct { + DeploymentsReady InventoryConditionReason + ErrorGettingDeploymentInformation InventoryConditionReason + DeploymentNotFound InventoryConditionReason + ServerArgumentsError InventoryConditionReason }{ DeploymentsReady: "AllDeploymentsReady", ErrorGettingDeploymentInformation: "ErrorGettingDeploymentInformation", @@ -41,14 +41,14 @@ var ORANO2IMSConditionReasons = struct { ServerArgumentsError: "ServerArgumentsError", } -var MapAvailableDeploymentNameConditionType = map[string]ORANO2IMSConditionType{ - ORANO2IMSMetadataServerName: ORANO2IMSConditionTypes.MetadataServerAvailable, - ORANO2IMSDeploymentManagerServerName: ORANO2IMSConditionTypes.DeploymentServerAvailable, - ORANO2IMSResourceServerName: ORANO2IMSConditionTypes.ResourceServerAvailable, +var MapAvailableDeploymentNameConditionType = map[string]InventoryConditionType{ + InventoryMetadataServerName: InventoryConditionTypes.MetadataServerAvailable, + InventoryDeploymentManagerServerName: InventoryConditionTypes.DeploymentServerAvailable, + InventoryResourceServerName: InventoryConditionTypes.ResourceServerAvailable, } -var MapErrorDeploymentNameConditionType = map[string]ORANO2IMSConditionType{ - ORANO2IMSMetadataServerName: ORANO2IMSConditionTypes.MetadataServerError, - ORANO2IMSDeploymentManagerServerName: ORANO2IMSConditionTypes.DeploymentServerError, - ORANO2IMSResourceServerName: ORANO2IMSConditionTypes.ResourceServerError, +var MapErrorDeploymentNameConditionType = map[string]InventoryConditionType{ + InventoryMetadataServerName: InventoryConditionTypes.MetadataServerError, + InventoryDeploymentManagerServerName: InventoryConditionTypes.DeploymentServerError, + InventoryResourceServerName: InventoryConditionTypes.ResourceServerError, } diff --git a/internal/controllers/utils/utils.go b/internal/controllers/utils/utils.go index ee250415..b959ef8b 100644 --- a/internal/controllers/utils/utils.go +++ b/internal/controllers/utils/utils.go @@ -259,7 +259,7 @@ func extensionsToExtensionArgs(extensions []string) []string { } func GetDeploymentVolumes(serverName string) []corev1.Volume { - if serverName == ORANO2IMSMetadataServerName || serverName == ORANO2IMSResourceServerName { + if serverName == InventoryMetadataServerName || serverName == InventoryResourceServerName { return []corev1.Volume{ { Name: "tls", @@ -272,7 +272,7 @@ func GetDeploymentVolumes(serverName string) []corev1.Volume { } } - if serverName == ORANO2IMSDeploymentManagerServerName { + if serverName == InventoryDeploymentManagerServerName { return []corev1.Volume{ { Name: "tls", @@ -297,7 +297,7 @@ func GetDeploymentVolumes(serverName string) []corev1.Volume { } func GetDeploymentVolumeMounts(serverName string) []corev1.VolumeMount { - if serverName == ORANO2IMSMetadataServerName || serverName == ORANO2IMSResourceServerName { + if serverName == InventoryMetadataServerName || serverName == InventoryResourceServerName { return []corev1.VolumeMount{ { Name: "tls", @@ -306,7 +306,7 @@ func GetDeploymentVolumeMounts(serverName string) []corev1.VolumeMount { } } - if serverName == ORANO2IMSDeploymentManagerServerName { + if serverName == InventoryDeploymentManagerServerName { return []corev1.VolumeMount{ { Name: "tls", @@ -377,7 +377,7 @@ func getACMNamespace(ctx context.Context, c client.Client) (string, error) { } // getSearchAPI will dynamically obtain the search API. -func getSearchAPI(ctx context.Context, c client.Client, orano2ims *oranv1alpha1.ORANO2IMS) (string, error) { +func getSearchAPI(ctx context.Context, c client.Client, inventory *oranv1alpha1.Inventory) (string, error) { // Find the ACM namespace. acmNamespace, err := getACMNamespace(ctx, c) if err != nil { @@ -389,10 +389,10 @@ func getSearchAPI(ctx context.Context, c client.Client, orano2ims *oranv1alpha1. // IngressHost example: o2ims.apps.lab.karmalabs.corp // Note: The domain could also be obtained from the spec.host of the search-api route in the // ACM namespace. - ingressSplit := strings.Split(orano2ims.Spec.IngressHost, ".apps") + ingressSplit := strings.Split(inventory.Spec.IngressHost, ".apps") if len(ingressSplit) != 2 { return "", fmt.Errorf("the searchAPIBackendURL could not be obtained from the IngressHost. " + - "Directly specify the searchAPIBackendURL in the ORANO2IMS CR or update the IngressHost") + "Directly specify the searchAPIBackendURL in the Inventory CR or update the IngressHost") } domain := ".apps" + ingressSplit[len(ingressSplit)-1] @@ -403,24 +403,24 @@ func getSearchAPI(ctx context.Context, c client.Client, orano2ims *oranv1alpha1. } func GetServerArgs(ctx context.Context, c client.Client, - orano2ims *oranv1alpha1.ORANO2IMS, + inventory *oranv1alpha1.Inventory, serverName string) (result []string, err error) { // MetadataServer - if serverName == ORANO2IMSMetadataServerName { + if serverName == InventoryMetadataServerName { result = slices.Clone(MetadataServerArgs) result = append( result, - fmt.Sprintf("--cloud-id=%s", orano2ims.Spec.CloudId), - fmt.Sprintf("--external-address=https://%s", orano2ims.Spec.IngressHost)) + fmt.Sprintf("--cloud-id=%s", inventory.Spec.CloudId), + fmt.Sprintf("--external-address=https://%s", inventory.Spec.IngressHost)) return } // ResourceServer - if serverName == ORANO2IMSResourceServerName { - searchAPI := orano2ims.Spec.ResourceServerConfig.BackendURL + if serverName == InventoryResourceServerName { + searchAPI := inventory.Spec.ResourceServerConfig.BackendURL if searchAPI == "" { - searchAPI, err = getSearchAPI(ctx, c, orano2ims) + searchAPI, err = getSearchAPI(ctx, c, inventory) if err != nil { return nil, err } @@ -431,34 +431,34 @@ func GetServerArgs(ctx context.Context, c client.Client, // Add the cloud-id, backend-url, and token args: result = append( result, - fmt.Sprintf("--cloud-id=%s", orano2ims.Spec.CloudId), + fmt.Sprintf("--cloud-id=%s", inventory.Spec.CloudId), fmt.Sprintf("--backend-url=%s", searchAPI), - GetBackendTokenArg(orano2ims.Spec.ResourceServerConfig.BackendToken)) + GetBackendTokenArg(inventory.Spec.ResourceServerConfig.BackendToken)) return result, nil } // DeploymentManagerServer - if serverName == ORANO2IMSDeploymentManagerServerName { + if serverName == InventoryDeploymentManagerServerName { result = slices.Clone(DeploymentManagerServerArgs) // Set the cloud identifier: result = append( result, - fmt.Sprintf("--cloud-id=%s", orano2ims.Spec.CloudId), + fmt.Sprintf("--cloud-id=%s", inventory.Spec.CloudId), ) // Set the backend type: - if orano2ims.Spec.DeploymentManagerServerConfig.BackendType != "" { + if inventory.Spec.DeploymentManagerServerConfig.BackendType != "" { result = append( result, - fmt.Sprintf("--backend-type=%s", orano2ims.Spec.DeploymentManagerServerConfig.BackendType), + fmt.Sprintf("--backend-type=%s", inventory.Spec.DeploymentManagerServerConfig.BackendType), ) } // If no backend URL has been provided then use the default URL of the Kubernetes // API server of the cluster: - backendURL := orano2ims.Spec.DeploymentManagerServerConfig.BackendURL + backendURL := inventory.Spec.DeploymentManagerServerConfig.BackendURL if backendURL == "" { backendURL = defaultBackendURL } @@ -467,10 +467,10 @@ func GetServerArgs(ctx context.Context, c client.Client, result = append( result, fmt.Sprintf("--backend-url=%s", backendURL), - GetBackendTokenArg(orano2ims.Spec.DeploymentManagerServerConfig.BackendToken)) + GetBackendTokenArg(inventory.Spec.DeploymentManagerServerConfig.BackendToken)) // Add the extensions: - extensionsArgsArray := extensionsToExtensionArgs(orano2ims.Spec.DeploymentManagerServerConfig.Extensions) + extensionsArgsArray := extensionsToExtensionArgs(inventory.Spec.DeploymentManagerServerConfig.Extensions) result = append(result, extensionsArgsArray...) return diff --git a/internal/controllers/utils/utils_test.go b/internal/controllers/utils/utils_test.go index 4bd6da0d..33e8559b 100644 --- a/internal/controllers/utils/utils_test.go +++ b/internal/controllers/utils/utils_test.go @@ -39,25 +39,25 @@ import ( // Scheme used for the tests: var suitescheme = clientgoscheme.Scheme -func TestORANO2IMSControllerUtils(t *testing.T) { +func TestInventoryControllerUtils(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "Controller Utils Suite") } //nolint:unparam func getFakeClientFromObjects(objs ...client.Object) (client.WithWatch, error) { - return fake.NewClientBuilder().WithScheme(suitescheme).WithObjects(objs...).WithStatusSubresource(&oranv1alpha1.ORANO2IMS{}).Build(), nil + return fake.NewClientBuilder().WithScheme(suitescheme).WithObjects(objs...).WithStatusSubresource(&oranv1alpha1.Inventory{}).Build(), nil } var _ = Describe("ExtensionUtils", func() { It("The container args contain all the extensions args", func() { - orano2ims := &oranv1alpha1.ORANO2IMS{ + Inventory := &oranv1alpha1.Inventory{ ObjectMeta: metav1.ObjectMeta{ Name: "oran-o2ims-sample-1", - Namespace: ORANO2IMSNamespace, + Namespace: InventoryNamespace, }, - Spec: oranv1alpha1.ORANO2IMSSpec{ + Spec: oranv1alpha1.InventorySpec{ DeploymentManagerServerConfig: oranv1alpha1.DeploymentManagerServerConfig{ // The below extension matches the following CRD extensions entry: // @@ -81,15 +81,15 @@ var _ = Describe("ExtensionUtils", func() { }, }, } - objs := []client.Object{orano2ims} + objs := []client.Object{Inventory} fakeClient, err := getFakeClientFromObjects(objs...) Expect(err).ToNot(HaveOccurred()) - actualArgs, err := GetServerArgs(context.TODO(), fakeClient, orano2ims, ORANO2IMSDeploymentManagerServerName) + actualArgs, err := GetServerArgs(context.TODO(), fakeClient, Inventory, InventoryDeploymentManagerServerName) Expect(err).ToNot(HaveOccurred()) expectedArgs := DeploymentManagerServerArgs expectedArgs = append(expectedArgs, - fmt.Sprintf("--cloud-id=%s", orano2ims.Spec.CloudId), + fmt.Sprintf("--cloud-id=%s", Inventory.Spec.CloudId), fmt.Sprintf("--backend-url=%s", defaultBackendURL), fmt.Sprintf("--backend-token-file=%s", defaultBackendTokenFile), ) @@ -100,25 +100,25 @@ var _ = Describe("ExtensionUtils", func() { }) It("No extension args", func() { - orano2ims := &oranv1alpha1.ORANO2IMS{ + Inventory := &oranv1alpha1.Inventory{ ObjectMeta: metav1.ObjectMeta{ Name: "oran-o2ims-sample-1", - Namespace: ORANO2IMSNamespace, + Namespace: InventoryNamespace, }, - Spec: oranv1alpha1.ORANO2IMSSpec{ + Spec: oranv1alpha1.InventorySpec{ DeploymentManagerServerConfig: oranv1alpha1.DeploymentManagerServerConfig{}, }, } - objs := []client.Object{orano2ims} + objs := []client.Object{Inventory} fakeClient, err := getFakeClientFromObjects(objs...) Expect(err).ToNot(HaveOccurred()) - actualArgs, err := GetServerArgs(context.TODO(), fakeClient, orano2ims, ORANO2IMSDeploymentManagerServerName) + actualArgs, err := GetServerArgs(context.TODO(), fakeClient, Inventory, InventoryDeploymentManagerServerName) Expect(err).ToNot(HaveOccurred()) expectedArgs := DeploymentManagerServerArgs expectedArgs = append(expectedArgs, - fmt.Sprintf("--cloud-id=%s", orano2ims.Spec.CloudId), + fmt.Sprintf("--cloud-id=%s", Inventory.Spec.CloudId), fmt.Sprintf("--backend-url=%s", defaultBackendURL), fmt.Sprintf("--backend-token-file=%s", defaultBackendTokenFile), ) @@ -128,8 +128,8 @@ var _ = Describe("ExtensionUtils", func() { var _ = Describe("DoesK8SResourceExist", func() { - suitescheme.AddKnownTypes(oranv1alpha1.GroupVersion, &oranv1alpha1.ORANO2IMS{}) - suitescheme.AddKnownTypes(oranv1alpha1.GroupVersion, &oranv1alpha1.ORANO2IMSList{}) + suitescheme.AddKnownTypes(oranv1alpha1.GroupVersion, &oranv1alpha1.Inventory{}) + suitescheme.AddKnownTypes(oranv1alpha1.GroupVersion, &oranv1alpha1.InventoryList{}) suitescheme.AddKnownTypes(appsv1.SchemeGroupVersion, &appsv1.Deployment{}) suitescheme.AddKnownTypes(appsv1.SchemeGroupVersion, &appsv1.DeploymentList{}) @@ -152,12 +152,12 @@ var _ = Describe("DoesK8SResourceExist", func() { Expect(err).ToNot(HaveOccurred()) It("If deployment does not exist, it will be created", func() { - orano2ims := &oranv1alpha1.ORANO2IMS{ + Inventory := &oranv1alpha1.Inventory{ ObjectMeta: metav1.ObjectMeta{ Name: "oran-o2ims-sample-1", - Namespace: ORANO2IMSNamespace, + Namespace: InventoryNamespace, }, - Spec: oranv1alpha1.ORANO2IMSSpec{}, + Spec: oranv1alpha1.InventorySpec{}, } deployment := &appsv1.Deployment{ @@ -174,7 +174,7 @@ var _ = Describe("DoesK8SResourceExist", func() { // Create the deployment. err = CreateK8sCR(context.TODO(), fakeClient, - deployment, orano2ims, UPDATE) + deployment, Inventory, UPDATE) Expect(err).ToNot(HaveOccurred()) // Check that the deployment has been created. @@ -185,12 +185,12 @@ var _ = Describe("DoesK8SResourceExist", func() { }) It("If deployment does exist, it will be updated", func() { - orano2ims := &oranv1alpha1.ORANO2IMS{ + Inventory := &oranv1alpha1.Inventory{ ObjectMeta: metav1.ObjectMeta{ Name: "oran-o2ims-sample-1", - Namespace: ORANO2IMSNamespace, + Namespace: InventoryNamespace, }, - Spec: oranv1alpha1.ORANO2IMSSpec{}, + Spec: oranv1alpha1.InventorySpec{}, } deployment := &appsv1.Deployment{ @@ -201,7 +201,7 @@ var _ = Describe("DoesK8SResourceExist", func() { Spec: appsv1.DeploymentSpec{ Template: corev1.PodTemplateSpec{ Spec: corev1.PodSpec{ - ServiceAccountName: ORANO2IMSDeploymentManagerServerName, + ServiceAccountName: InventoryDeploymentManagerServerName, }, }, }, @@ -219,7 +219,7 @@ var _ = Describe("DoesK8SResourceExist", func() { // Create the deployment. err = CreateK8sCR(context.TODO(), fakeClient, - deployment, orano2ims, UPDATE) + deployment, Inventory, UPDATE) Expect(err).ToNot(HaveOccurred()) // Check that the deployment has been created. @@ -235,7 +235,7 @@ var _ = Describe("DoesK8SResourceExist", func() { // Update the SA Name. newDeployment.Spec.Template.Spec.ServiceAccountName = "new-sa-name" err = CreateK8sCR(context.TODO(), fakeClient, - newDeployment, orano2ims, UPDATE) + newDeployment, Inventory, UPDATE) Expect(err).ToNot(HaveOccurred()) // Get the deployment and check that the SA Name has been updated. @@ -363,21 +363,21 @@ var _ = Describe("searchAPI", func() { Version: "v1", }) - orano2ims := &oranv1alpha1.ORANO2IMS{ + Inventory := &oranv1alpha1.Inventory{ ObjectMeta: metav1.ObjectMeta{ Name: "oran-o2ims-sample-1", - Namespace: ORANO2IMSNamespace, + Namespace: InventoryNamespace, }, - Spec: oranv1alpha1.ORANO2IMSSpec{ + Spec: oranv1alpha1.InventorySpec{ DeploymentManagerServerConfig: oranv1alpha1.DeploymentManagerServerConfig{}, IngressHost: "o2ims.apps.lab.karmalabs.corp", }, } - objs := []client.Object{mce, orano2ims} + objs := []client.Object{mce, Inventory} fakeClient, err := getFakeClientFromObjects(objs...) Expect(err).ToNot(HaveOccurred()) - searchAPI, err := getSearchAPI(context.TODO(), fakeClient, orano2ims) + searchAPI, err := getSearchAPI(context.TODO(), fakeClient, Inventory) Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring("multiclusterengine labels do not contain the installer.namespace key")) Expect(searchAPI).To(Equal("")) @@ -404,26 +404,26 @@ var _ = Describe("searchAPI", func() { Version: "v1", }) - orano2ims := &oranv1alpha1.ORANO2IMS{ + Inventory := &oranv1alpha1.Inventory{ ObjectMeta: metav1.ObjectMeta{ Name: "oran-o2ims-sample-1", - Namespace: ORANO2IMSNamespace, + Namespace: InventoryNamespace, }, - Spec: oranv1alpha1.ORANO2IMSSpec{ + Spec: oranv1alpha1.InventorySpec{ DeploymentManagerServerConfig: oranv1alpha1.DeploymentManagerServerConfig{}, IngressHost: "o2ims.app.lab.karmalabs.corp", }, } - objs := []client.Object{mce, orano2ims} + objs := []client.Object{mce, Inventory} fakeClient, err := getFakeClientFromObjects(objs...) Expect(err).ToNot(HaveOccurred()) - searchAPI, err := getSearchAPI(context.TODO(), fakeClient, orano2ims) + searchAPI, err := getSearchAPI(context.TODO(), fakeClient, Inventory) Expect(searchAPI).To(BeEmpty()) Expect(err).To(HaveOccurred()) Expect(err.Error()).To(ContainSubstring( "the searchAPIBackendURL could not be obtained from the IngressHost. " + - "Directly specify the searchAPIBackendURL in the ORANO2IMS CR or update the IngressHost")) + "Directly specify the searchAPIBackendURL in the Inventory CR or update the IngressHost")) }) It("The ingress host has the expected format (containing .apps) and the searchAPI is returned", func() { @@ -447,21 +447,21 @@ var _ = Describe("searchAPI", func() { Version: "v1", }) - orano2ims := &oranv1alpha1.ORANO2IMS{ + Inventory := &oranv1alpha1.Inventory{ ObjectMeta: metav1.ObjectMeta{ Name: "oran-o2ims-sample-1", - Namespace: ORANO2IMSNamespace, + Namespace: InventoryNamespace, }, - Spec: oranv1alpha1.ORANO2IMSSpec{ + Spec: oranv1alpha1.InventorySpec{ DeploymentManagerServerConfig: oranv1alpha1.DeploymentManagerServerConfig{}, IngressHost: "o2ims.apps.lab.karmalabs.corp", }, } - objs := []client.Object{mce, orano2ims} + objs := []client.Object{mce, Inventory} fakeClient, err := getFakeClientFromObjects(objs...) Expect(err).ToNot(HaveOccurred()) - searchAPI, err := getSearchAPI(context.TODO(), fakeClient, orano2ims) + searchAPI, err := getSearchAPI(context.TODO(), fakeClient, Inventory) Expect(err).ToNot(HaveOccurred()) Expect(searchAPI).To(Equal("https://search-api-open-cluster-management.apps.lab.karmalabs.corp")) }) @@ -1554,7 +1554,7 @@ var _ = Describe("GetLabelsForPolicies", func() { It("returns no error if the cluster-version label exists", func() { - clusterLabels["cluster-version"] = "v4.16" + clusterLabels["cluster-version"] = "v4.17" err := CheckClusterLabelsForPolicies(clusterName, clusterLabels) Expect(err).ToNot(HaveOccurred()) }) 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 06b57cac..4cf5298d 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 6ea0db09..2de02ceb 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 @@ -20,8 +20,14 @@ import ( // NodeSpec describes a node presents a hardware server type NodeSpec struct { - NodePool string `json:"nodePool"` + // NodePool + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="NodePool",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} + NodePool string `json:"nodePool"` + // GroupName + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="GroupName",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} GroupName string `json:"groupName"` + // HwProfile + //+operator-sdk:csv:customresourcedefinitions:type=spec,displayName="HwProfile",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} HwProfile string `json:"hwProfile"` } @@ -52,6 +58,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_pools.go b/vendor/github.com/openshift-kni/oran-o2ims/api/hardwaremanagement/v1alpha1/node_pools.go index 645499c8..e67579e5 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="CloudID",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="LocationSpec",xDescriptors={"urn:alm:descriptor:com.tectonic.ui:text"} LocationSpec `json:",inline"` NodeGroup []NodeGroup `json:"nodeGroup"` @@ -64,6 +71,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"`