Skip to content

Commit

Permalink
Change forces control to Kuadrant.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Boomatang committed Jul 8, 2024
1 parent 8da1d63 commit de6e57f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions controllers/kuadrant_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit de6e57f

Please sign in to comment.