@@ -47,7 +47,6 @@ import (
4747 ctrl "sigs.k8s.io/controller-runtime"
4848 "sigs.k8s.io/controller-runtime/pkg/builder"
4949 "sigs.k8s.io/controller-runtime/pkg/client"
50- "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
5150 "sigs.k8s.io/controller-runtime/pkg/event"
5251 "sigs.k8s.io/controller-runtime/pkg/predicate"
5352 "sigs.k8s.io/controller-runtime/pkg/reconcile"
@@ -110,22 +109,11 @@ func (r *ReconcileWebSphereLiberty) Reconcile(ctx context.Context, request ctrl.
110109 configMap , err := r .GetOpConfigMap (OperatorName , ns )
111110 if err != nil {
112111 reqLogger .Info ("Failed to get websphere-liberty-operator config map, error: " + err .Error ())
113- common .Config = common .DefaultOpConfig ()
114- configMap = & corev1.ConfigMap {ObjectMeta : metav1.ObjectMeta {Name : OperatorName , Namespace : ns }}
115- configMap .Data = common .Config
112+ oputils .CreateConfigMap (OperatorName )
116113 } else {
117114 common .Config .LoadFromConfigMap (configMap )
118115 }
119116
120- _ , err = controllerutil .CreateOrUpdate (context .TODO (), r .GetClient (), configMap , func () error {
121- configMap .Data = common .Config
122- return nil
123- })
124-
125- if err != nil {
126- reqLogger .Info ("Failed to create or update websphere-liberty-operator config map, error: " + err .Error ())
127- }
128-
129117 // Fetch the WebSphereLiberty instance
130118 instance := & webspherelibertyv1.WebSphereLibertyApplication {}
131119 var ba common.BaseComponent = instance
@@ -333,6 +321,7 @@ func (r *ReconcileWebSphereLiberty) Reconcile(ctx context.Context, request ctrl.
333321 }
334322 }
335323 if isKnativeSupported {
324+ reqLogger .Info ("Knative is supported and Knative Service is enabled" )
336325 ksvc := & servingv1.Service {ObjectMeta : defaultMeta }
337326 err = r .CreateOrUpdate (ksvc , instance , func () error {
338327 oputils .CustomizeKnativeService (ksvc , instance )
@@ -345,6 +334,7 @@ func (r *ReconcileWebSphereLiberty) Reconcile(ctx context.Context, request ctrl.
345334 }
346335
347336 instance .Status .Versions .Reconciled = lutils .OperandVersion
337+ reqLogger .Info ("Reconcile WebSphereLibertyApplication - completed" )
348338 return r .ManageSuccess (common .StatusConditionTypeReconciled , instance )
349339 }
350340 return r .ManageError (errors .New ("failed to reconcile Knative service as operator could not find Knative CRDs" ), common .StatusConditionTypeReconciled , instance )
0 commit comments