From e540b0748da10fec4c0c7e97af2c92520a10f938 Mon Sep 17 00:00:00 2001 From: Jim Fitzpatrick Date: Wed, 5 Jun 2024 13:55:24 +0100 Subject: [PATCH] Change forces control to Kuadrant. If the use sets any value for authorino in the Kuadrant CR all fields that can be managed are managed. This still does allow the user to set fields in the authorino CR that are out of scope of the Kuadrant CR. --- controllers/kuadrant_controller.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/controllers/kuadrant_controller.go b/controllers/kuadrant_controller.go index a26c5ebad..0fec08465 100644 --- a/controllers/kuadrant_controller.go +++ b/controllers/kuadrant_controller.go @@ -499,24 +499,36 @@ func (r *KuadrantReconciler) reconcileAuthorino(ctx context.Context, kObj *kuadr } if kObj.Spec.Authorino != nil { + authorino.Spec.EvaluatorCacheSize = nil if kObj.Spec.Authorino.EvaluatorCacheSize != nil { authorino.Spec.EvaluatorCacheSize = kObj.Spec.Authorino.EvaluatorCacheSize } + authorino.Spec.Metrics = authorinov1beta1.Metrics{} if kObj.Spec.Authorino.Metrics != nil { authorino.Spec.Metrics = *kObj.Spec.Authorino.Metrics } + + authorino.Spec.Replicas = nil if kObj.Spec.Authorino.Replicas != nil { authorino.Spec.Replicas = kObj.Spec.Authorino.Replicas } + + authorino.Spec.Tracing = authorinov1beta1.Tracing{} if kObj.Spec.Authorino.Tracing != nil { authorino.Spec.Tracing = *kObj.Spec.Authorino.Tracing } + + authorino.Spec.OIDCServer = authorinov1beta1.OIDCServer{} if kObj.Spec.Authorino.OIDCServer != nil { authorino.Spec.OIDCServer = *kObj.Spec.Authorino.OIDCServer } + + authorino.Spec.Listener = authorinov1beta1.Listener{} if kObj.Spec.Authorino.Listener != nil { authorino.Spec.Listener = kuadranttools.MapListenerSpec(&authorino.Spec.Listener, *kObj.Spec.Authorino.Listener) } + + authorino.Spec.Volumes = authorinov1beta1.VolumesSpec{} if kObj.Spec.Authorino.Volumes != nil { authorino.Spec.Volumes = *kObj.Spec.Authorino.Volumes }