From 8babd7f73f7e3ac2228e57d9ed546aa31bf2206c Mon Sep 17 00:00:00 2001 From: Sunil Thaha Date: Tue, 21 May 2024 15:09:30 +1000 Subject: [PATCH] fix(OLM): ensure kepler can be created through Console Previously, when creating Kepler instance through OpenShift Console / UI, the redfish spec which is optional also had its fields initialized as well. Notably `redfish.secrefRef` was initialized to "". This prevented creation of `kepler` instance since the `secretRef` is a required field. This commit fixes the issue by marking `redfish` as `optional` and updating the default sample to reflect that. Signed-off-by: Sunil Thaha --- bundle/manifests/kepler-operator.clusterserviceversion.yaml | 3 ++- config/samples/kepler.system_v1alpha1_kepler.yaml | 1 + pkg/api/v1alpha1/kepler_types.go | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/bundle/manifests/kepler-operator.clusterserviceversion.yaml b/bundle/manifests/kepler-operator.clusterserviceversion.yaml index cc23c2d0..3fa7514e 100644 --- a/bundle/manifests/kepler-operator.clusterserviceversion.yaml +++ b/bundle/manifests/kepler-operator.clusterserviceversion.yaml @@ -19,7 +19,8 @@ metadata: "exporter": { "deployment": { "port": 9103 - } + }, + "redfish": null } } } diff --git a/config/samples/kepler.system_v1alpha1_kepler.yaml b/config/samples/kepler.system_v1alpha1_kepler.yaml index 4987cc2d..9174ee10 100644 --- a/config/samples/kepler.system_v1alpha1_kepler.yaml +++ b/config/samples/kepler.system_v1alpha1_kepler.yaml @@ -10,4 +10,5 @@ spec: exporter: deployment: port: 9103 + redfish: null diff --git a/pkg/api/v1alpha1/kepler_types.go b/pkg/api/v1alpha1/kepler_types.go index 8ee31c89..21d5a274 100644 --- a/pkg/api/v1alpha1/kepler_types.go +++ b/pkg/api/v1alpha1/kepler_types.go @@ -61,7 +61,10 @@ type RedfishSpec struct { type ExporterSpec struct { Deployment ExporterDeploymentSpec `json:"deployment,omitempty"` - Redfish *RedfishSpec `json:"redfish,omitempty"` + + // +optional + // +kubebuilder:validation:optional + Redfish *RedfishSpec `json:"redfish,omitempty"` } // KeplerSpec defines the desired state of Kepler