From de6e57fc98f7e92ec3608cacadcb1bd1ce66a886 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 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/controllers/kuadrant_controller.go b/controllers/kuadrant_controller.go index a26c5ebad..b67d17cc4 100644 --- a/controllers/kuadrant_controller.go +++ b/controllers/kuadrant_controller.go @@ -499,24 +499,38 @@ 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{} + authorino.Spec.OIDCServer.Tls.Enabled = ptr.To(false) if kObj.Spec.Authorino.OIDCServer != nil { authorino.Spec.OIDCServer = *kObj.Spec.Authorino.OIDCServer } + + authorino.Spec.Listener = authorinov1beta1.Listener{} + authorino.Spec.Listener.Tls.Enabled = ptr.To(false) 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 }