@@ -101,11 +101,6 @@ func (r *RuntimeComponentReconciler) Reconcile(ctx context.Context, req ctrl.Req
101101 ns = r .watchNamespaces [0 ]
102102 }
103103
104- // This reconcile context is cancelled right before the Reconcile function terminates or when the parent context ctx is cancelled (such as in operator leader election), whichever happens first.
105- // Resources that require cleanup may use this context to hook into program execution before a function return.
106- recCtx , cancel := context .WithCancel (ctx )
107- defer cancel ()
108-
109104 configMap , err := r .GetOpConfigMap (OperatorName , ns )
110105 if err != nil {
111106 reqLogger .Info ("Failed to find runtime-component-operator config map" )
@@ -243,7 +238,7 @@ func (r *RuntimeComponentReconciler) Reconcile(ctx context.Context, req ctrl.Req
243238 if serviceAccountName == "" {
244239 serviceAccount := & corev1.ServiceAccount {ObjectMeta : defaultMeta }
245240 err = r .CreateOrUpdate (serviceAccount , instance , func () error {
246- return appstacksutils .CustomizeServiceAccount (recCtx , serviceAccount , instance , r .GetClient ())
241+ return appstacksutils .CustomizeServiceAccount (serviceAccount , instance , r .GetClient ())
247242 })
248243 if err != nil {
249244 reqLogger .Error (err , "Failed to reconcile ServiceAccount" )
@@ -262,7 +257,7 @@ func (r *RuntimeComponentReconciler) Reconcile(ctx context.Context, req ctrl.Req
262257
263258 // Check if the ServiceAccount has a valid pull secret before creating the deployment/statefulset
264259 // or setting up knative. Otherwise the pods can go into an ImagePullBackOff loop
265- saErr := appstacksutils .ServiceAccountPullSecretExists (recCtx , instance , r .GetClient ())
260+ saErr := appstacksutils .ServiceAccountPullSecretExists (instance , r .GetClient ())
266261 if saErr != nil {
267262 return r .ManageError (saErr , common .StatusConditionTypeReconciled , instance )
268263 }
@@ -324,7 +319,7 @@ func (r *RuntimeComponentReconciler) Reconcile(ctx context.Context, req ctrl.Req
324319 }
325320 }
326321
327- useCertmanager , err := r .GenerateSvcCertSecret (recCtx , ba , "rco" , "Runtime Component Operator" , "runtime-component-operator" )
322+ useCertmanager , err := r .GenerateSvcCertSecret (ba , "rco" , "Runtime Component Operator" , "runtime-component-operator" )
328323 if err != nil {
329324 reqLogger .Error (err , "Failed to reconcile CertManager Certificate" )
330325 return r .ManageError (err , common .StatusConditionTypeReconciled , instance )
@@ -370,7 +365,7 @@ func (r *RuntimeComponentReconciler) Reconcile(ctx context.Context, req ctrl.Req
370365 }
371366 }
372367
373- err = r .ReconcileBindings (recCtx , instance )
368+ err = r .ReconcileBindings (instance )
374369 if err != nil {
375370 return r .ManageError (err , common .StatusConditionTypeReconciled , ba )
376371 }
@@ -400,7 +395,7 @@ func (r *RuntimeComponentReconciler) Reconcile(ctx context.Context, req ctrl.Req
400395 err = r .CreateOrUpdate (statefulSet , instance , func () error {
401396 appstacksutils .CustomizeStatefulSet (statefulSet , instance )
402397 appstacksutils .CustomizePodSpec (& statefulSet .Spec .Template , instance )
403- if err := appstacksutils .CustomizePodWithSVCCertificate (recCtx , & statefulSet .Spec .Template , instance , r .GetClient ()); err != nil {
398+ if err := appstacksutils .CustomizePodWithSVCCertificate (& statefulSet .Spec .Template , instance , r .GetClient ()); err != nil {
404399 return err
405400 }
406401 appstacksutils .CustomizePersistence (statefulSet , instance )
@@ -432,7 +427,7 @@ func (r *RuntimeComponentReconciler) Reconcile(ctx context.Context, req ctrl.Req
432427 err = r .CreateOrUpdate (deploy , instance , func () error {
433428 appstacksutils .CustomizeDeployment (deploy , instance )
434429 appstacksutils .CustomizePodSpec (& deploy .Spec .Template , instance )
435- if err := appstacksutils .CustomizePodWithSVCCertificate (recCtx , & deploy .Spec .Template , instance , r .GetClient ()); err != nil {
430+ if err := appstacksutils .CustomizePodWithSVCCertificate (& deploy .Spec .Template , instance , r .GetClient ()); err != nil {
436431 return err
437432 }
438433 return nil
@@ -534,7 +529,7 @@ func (r *RuntimeComponentReconciler) Reconcile(ctx context.Context, req ctrl.Req
534529 } else if ok {
535530 if instance .Spec .Monitoring != nil && (instance .Spec .CreateKnativeService == nil || ! * instance .Spec .CreateKnativeService ) {
536531 // Validate the monitoring endpoints' configuration before creating/updating the ServiceMonitor
537- if err := appstacksutils .ValidatePrometheusMonitoringEndpoints (recCtx , instance , r .GetClient (), instance .GetNamespace ()); err != nil {
532+ if err := appstacksutils .ValidatePrometheusMonitoringEndpoints (instance , r .GetClient (), instance .GetNamespace ()); err != nil {
538533 return r .ManageError (err , common .StatusConditionTypeReconciled , instance )
539534 }
540535 sm := & prometheusv1.ServiceMonitor {ObjectMeta : defaultMeta }
0 commit comments