Skip to content

Commit 874b18b

Browse files
authored
Add order in marker to reorder CSV + remove context which is not in use (#419)
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
1 parent 3012213 commit 874b18b

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

apis/datasciencecluster/v1alpha1/datasciencecluster_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
// Defines the desired state of DataScienceCluster
3434
type DataScienceClusterSpec struct {
3535
// Override and fine tune specific component configurations.
36-
// +operator-sdk:csv:customresourcedefinitions:type=spec
36+
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=1
3737
Components Components `json:"components,omitempty"`
3838
}
3939

apis/dscinitialization/v1alpha1/dscinitialization_types.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,18 @@ import (
2323
)
2424

2525
// DSCInitializationSpec defines the desired state of DSCInitialization
26+
// +operator-sdk:csv:customresourcedefinitions:order=1
2627
type DSCInitializationSpec struct {
2728
// +kubebuilder:default:=opendatahub
2829
// Namespace for applications to be installed, non-configurable, default to "opendatahub"
29-
// +operator-sdk:csv:customresourcedefinitions:type=spec
30+
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=1
3031
ApplicationsNamespace string `json:"applicationsNamespace"`
3132
// Enable monitoring on specified namespace
32-
// +operator-sdk:csv:customresourcedefinitions:type=spec
33+
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=2
3334
// +optional
3435
Monitoring Monitoring `json:"monitoring,omitempty"`
3536
// Internal development useful field
36-
// +operator-sdk:csv:customresourcedefinitions:type=spec
37+
// +operator-sdk:csv:customresourcedefinitions:type=spec,order=3
3738
// +optional
3839
ManifestsUri string `json:"manifestsUri,omitempty"`
3940
}

bundle/manifests/opendatahub-operator.clusterserviceversion.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,12 @@ spec:
194194
default to "opendatahub"
195195
displayName: Applications Namespace
196196
path: applicationsNamespace
197-
- description: Internal development useful field
198-
displayName: Manifests Uri
199-
path: manifestsUri
200197
- description: Enable monitoring on specified namespace
201198
displayName: Monitoring
202199
path: monitoring
200+
- description: Internal development useful field
201+
displayName: Manifests Uri
202+
path: manifestsUri
203203
statusDescriptors:
204204
- description: Conditions describes the state of the DSCInitializationStatus
205205
resource.

config/manifests/bases/opendatahub-operator.clusterserviceversion.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ spec:
3434
default to "opendatahub"
3535
displayName: Applications Namespace
3636
path: applicationsNamespace
37-
- description: Internal development useful field
38-
displayName: Manifests Uri
39-
path: manifestsUri
4037
- description: Enable monitoring on specified namespace
4138
displayName: Monitoring
4239
path: monitoring
40+
- description: Internal development useful field
41+
displayName: Manifests Uri
42+
path: manifestsUri
4343
statusDescriptors:
4444
- description: Conditions describes the state of the DSCInitializationStatus
4545
resource.

controllers/datasciencecluster/datasciencecluster_controller.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,46 +127,46 @@ func (r *DataScienceClusterReconciler) Reconcile(ctx context.Context, req ctrl.R
127127

128128
// reconcile dashboard component
129129
if instance, err = r.reconcileSubComponent(instance, dashboard.ComponentName, instance.Spec.Components.Dashboard.Enabled,
130-
&(instance.Spec.Components.Dashboard), ctx); err != nil {
130+
&(instance.Spec.Components.Dashboard)); err != nil {
131131
// no need to log any errors as this is done in the reconcileSubComponent method
132132
componentErrorList[dashboard.ComponentName] = err
133133
}
134134

135135
// reconcile DataSciencePipelines component
136136
if instance, err = r.reconcileSubComponent(instance, datasciencepipelines.ComponentName, instance.Spec.Components.DataSciencePipelines.Enabled,
137-
&(instance.Spec.Components.DataSciencePipelines), ctx); err != nil {
137+
&(instance.Spec.Components.DataSciencePipelines)); err != nil {
138138
// no need to log any errors as this is done in the reconcileSubComponent method
139139
componentErrorList[datasciencepipelines.ComponentName] = err
140140
}
141141

142142
// reconcile Workbench component
143143
if instance, err = r.reconcileSubComponent(instance, workbenches.ComponentName, instance.Spec.Components.Workbenches.Enabled,
144-
&(instance.Spec.Components.Workbenches), ctx); err != nil {
144+
&(instance.Spec.Components.Workbenches)); err != nil {
145145
// no need to log any errors as this is done in the reconcileSubComponent method
146146
componentErrorList[workbenches.ComponentName] = err
147147
}
148148

149149
// reconcile Kserve component
150-
if instance, err = r.reconcileSubComponent(instance, kserve.ComponentName, instance.Spec.Components.Kserve.Enabled, &(instance.Spec.Components.Kserve), ctx); err != nil {
150+
if instance, err = r.reconcileSubComponent(instance, kserve.ComponentName, instance.Spec.Components.Kserve.Enabled, &(instance.Spec.Components.Kserve)); err != nil {
151151
// no need to log any errors as this is done in the reconcileSubComponent method
152152
componentErrorList[kserve.ComponentName] = err
153153
}
154154

155155
// reconcile ModelMesh component
156156
if instance, err = r.reconcileSubComponent(instance, modelmeshserving.ComponentName, instance.Spec.Components.ModelMeshServing.Enabled,
157-
&(instance.Spec.Components.ModelMeshServing), ctx); err != nil {
157+
&(instance.Spec.Components.ModelMeshServing)); err != nil {
158158
// no need to log any errors as this is done in the reconcileSubComponent method
159159
componentErrorList[modelmeshserving.ComponentName] = err
160160
}
161161

162162
// reconcile CodeFlare component
163-
if instance, err = r.reconcileSubComponent(instance, codeflare.ComponentName, instance.Spec.Components.CodeFlare.Enabled, &(instance.Spec.Components.CodeFlare), ctx); err != nil {
163+
if instance, err = r.reconcileSubComponent(instance, codeflare.ComponentName, instance.Spec.Components.CodeFlare.Enabled, &(instance.Spec.Components.CodeFlare)); err != nil {
164164
// no need to log any errors as this is done in the reconcileSubComponent method
165165
componentErrorList[codeflare.ComponentName] = err
166166
}
167167

168168
// reconcile Ray component
169-
if instance, err = r.reconcileSubComponent(instance, ray.ComponentName, instance.Spec.Components.Ray.Enabled, &(instance.Spec.Components.Ray), ctx); err != nil {
169+
if instance, err = r.reconcileSubComponent(instance, ray.ComponentName, instance.Spec.Components.Ray.Enabled, &(instance.Spec.Components.Ray)); err != nil {
170170
// no need to log any errors as this is done in the reconcileSubComponent method
171171
componentErrorList[ray.ComponentName] = err
172172
}
@@ -202,7 +202,7 @@ func (r *DataScienceClusterReconciler) Reconcile(ctx context.Context, req ctrl.R
202202
}
203203

204204
func (r *DataScienceClusterReconciler) reconcileSubComponent(instance *dsc.DataScienceCluster, componentName string, enabled bool,
205-
component components.ComponentInterface, ctx context.Context) (*dsc.DataScienceCluster, error) {
205+
component components.ComponentInterface) (*dsc.DataScienceCluster, error) {
206206

207207
// First set contidions to reflect a component is about to be reconciled
208208
instance, err := r.updateStatus(instance, func(saved *dsc.DataScienceCluster) {

controllers/secretgenerator/secretgenerator_controller.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ func (r *SecretGeneratorReconciler) SetupWithManager(mgr ctrl.Manager) error {
7878
// based on the specified type and complexity. This will avoid possible race
7979
// conditions when a deployment mounts the secret before it is reconciled
8080
func (r *SecretGeneratorReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctrl.Result, error) {
81-
_ = log.FromContext(ctx)
8281
foundSecret := &v1.Secret{}
8382
err := r.Client.Get(context.TODO(), request.NamespacedName, foundSecret)
8483
if err != nil {

0 commit comments

Comments
 (0)