@@ -63,35 +63,6 @@ const (
63
63
64
64
func (r * CommonServiceReconciler ) Reconcile (ctx context.Context , req ctrl.Request ) (ctrl.Result , error ) {
65
65
66
- if os .Getenv ("NO_OLM" ) == "true" {
67
- klog .Infof ("Reconciling CommonService: %s in non OLM environment" , req .NamespacedName )
68
-
69
- klog .Infof ("Start to Create ODLM CR in the namespace %s" , r .Bootstrap .CSData .OperatorNs )
70
- // Check if ODLM OperandRegistry and OperandConfig are created
71
- klog .Info ("Checking if OperandRegistry and OperandConfig CRD already exist" )
72
- existOpreg , _ := r .Bootstrap .CheckCRD (constant .OpregAPIGroupVersion , constant .OpregKind )
73
- existOpcon , _ := r .Bootstrap .CheckCRD (constant .OpregAPIGroupVersion , constant .OpconKind )
74
- // Install/update Opreg and Opcon resources before installing ODLM if CRDs exist
75
- if existOpreg && existOpcon {
76
-
77
- klog .Info ("Installing/Updating OperandRegistry" )
78
- if err := r .Bootstrap .InstallOrUpdateOpreg (true , "" ); err != nil {
79
- klog .Errorf ("Fail to Installing/Updating OperandConfig: %v" , err )
80
- return ctrl.Result {}, err
81
- }
82
-
83
- klog .Info ("Installing/Updating OperandConfig" )
84
- if err := r .Bootstrap .InstallOrUpdateOpcon (true ); err != nil {
85
- klog .Errorf ("Fail to Installing/Updating OperandConfig: %v" , err )
86
- return ctrl.Result {}, err
87
- }
88
- } else {
89
- klog .Error ("ODLM CRD not ready, waiting for it to be ready" )
90
- }
91
-
92
- return ctrl.Result {}, nil
93
- }
94
-
95
66
klog .Infof ("Reconciling CommonService: %s" , req .NamespacedName )
96
67
97
68
// Fetch the CommonService instance
@@ -124,6 +95,46 @@ func (r *CommonServiceReconciler) Reconcile(ctx context.Context, req ctrl.Reques
124
95
klog .Error ("Accept license by changing .spec.license.accept to true in the CommonService CR. Operator will not proceed until then" )
125
96
}
126
97
98
+ if os .Getenv ("NO_OLM" ) == "true" {
99
+ klog .Infof ("Reconciling CommonService: %s in non OLM environment" , req .NamespacedName )
100
+
101
+ // create ibm-cpp-config configmap
102
+ if err := configurationcollector .CreateUpdateConfig (r .Bootstrap ); err != nil {
103
+ klog .Errorf ("Fail to reconcile %s/%s: %v" , instance .Namespace , instance .Name , err )
104
+ return ctrl.Result {}, err
105
+ }
106
+
107
+ klog .Infof ("Start to Create ODLM CR in the namespace %s" , r .Bootstrap .CSData .OperatorNs )
108
+ // Check if ODLM OperandRegistry and OperandConfig are created
109
+ klog .Info ("Checking if OperandRegistry and OperandConfig CRD already exist" )
110
+ existOpreg , _ := r .Bootstrap .CheckCRD (constant .OpregAPIGroupVersion , constant .OpregKind )
111
+ existOpcon , _ := r .Bootstrap .CheckCRD (constant .OpregAPIGroupVersion , constant .OpconKind )
112
+ // Install/update Opreg and Opcon resources before installing ODLM if CRDs exist
113
+ if existOpreg && existOpcon {
114
+ klog .Info ("Installing/Updating OperandRegistry" )
115
+ if err := r .Bootstrap .InstallOrUpdateOpreg (true , "" ); err != nil {
116
+ klog .Errorf ("Fail to Installing/Updating OperandConfig: %v" , err )
117
+ return ctrl.Result {}, err
118
+ }
119
+
120
+ klog .Info ("Installing/Updating OperandConfig" )
121
+ if err := r .Bootstrap .InstallOrUpdateOpcon (true ); err != nil {
122
+ klog .Errorf ("Fail to Installing/Updating OperandConfig: %v" , err )
123
+ return ctrl.Result {}, err
124
+ }
125
+
126
+ // Temporary solution for EDB image ConfigMap reference
127
+ if err := r .Bootstrap .CreateEDBImageMaps (); err != nil {
128
+ klog .Errorf ("Failed to create EDB Image ConfigMap: %v" , err )
129
+ return ctrl.Result {}, err
130
+ }
131
+ } else {
132
+ klog .Error ("ODLM CRD not ready, waiting for it to be ready" )
133
+ }
134
+
135
+ return ctrl.Result {}, nil
136
+ }
137
+
127
138
// If the CommonService CR is not paused, continue to reconcile
128
139
if ! r .reconcilePauseRequest (instance ) {
129
140
if r .checkNamespace (req .NamespacedName .String ()) {
0 commit comments