@@ -14,6 +14,7 @@ See the License for the specific language governing permissions and
1414limitations under the License.
1515*/
1616
17+ // Package controllers contains the NeutronAPI controller for the neutron-operator.
1718package controllers
1819
1920import (
@@ -73,7 +74,7 @@ import (
7374// errTransportURLSecretNameNilOrEmpty
7475var errTransportURLSecretNameNilOrEmpty = errors .New ("transport_url secret name is nil or empty" )
7576
76- // getlogger returns a logger object with a prefix of "conroller .name" and aditional controller context fields
77+ // GetLogger returns a logger object with a prefix of "controller .name" and additional controller context fields
7778func (r * NeutronAPIReconciler ) GetLogger (ctx context.Context ) logr.Logger {
7879 return log .FromContext (ctx ).WithName ("Controllers" ).WithName ("NeutronAPI" )
7980}
@@ -119,7 +120,7 @@ func (r *NeutronAPIReconciler) Reconcile(ctx context.Context, req ctrl.Request)
119120
120121 // Fetch the NeutronAPI instance
121122 instance := & neutronv1beta1.NeutronAPI {}
122- err := r .Client . Get (ctx , req .NamespacedName , instance )
123+ err := r .Get (ctx , req .NamespacedName , instance )
123124 if err != nil {
124125 if k8s_errors .IsNotFound (err ) {
125126 // Request object not found, could have been deleted after reconcile request.
@@ -391,7 +392,7 @@ func (r *NeutronAPIReconciler) findObjectForSrc(ctx context.Context, src client.
391392 listOps := & client.ListOptions {
392393 Namespace : src .GetNamespace (),
393394 }
394- err := r .Client . List (ctx , crList , listOps )
395+ err := r .List (ctx , crList , listOps )
395396 if err != nil {
396397 Log .Error (err , fmt .Sprintf ("listing %s for namespace: %s" , crList .GroupVersionKind ().Kind , src .GetNamespace ()))
397398 return requests
@@ -532,7 +533,7 @@ func (r *NeutronAPIReconciler) reconcileInit(
532533 condition .TLSInputReadyCondition ,
533534 condition .RequestedReason ,
534535 condition .SeverityInfo ,
535- fmt . Sprintf ( condition .TLSInputReadyWaitingMessage , instance .Spec .TLS .CaBundleSecretName ) ))
536+ condition .TLSInputReadyWaitingMessage , instance .Spec .TLS .CaBundleSecretName ))
536537 return ctrl.Result {}, nil
537538 }
538539 instance .Status .Conditions .Set (condition .FalseCondition (
@@ -557,7 +558,7 @@ func (r *NeutronAPIReconciler) reconcileInit(
557558 condition .TLSInputReadyCondition ,
558559 condition .RequestedReason ,
559560 condition .SeverityInfo ,
560- fmt . Sprintf ( condition .TLSInputReadyWaitingMessage , err .Error () )))
561+ condition .TLSInputReadyWaitingMessage , err .Error ()))
561562 return ctrl.Result {}, nil
562563 }
563564 instance .Status .Conditions .Set (condition .FalseCondition (
@@ -582,7 +583,7 @@ func (r *NeutronAPIReconciler) reconcileInit(
582583 condition .TLSInputReadyCondition ,
583584 condition .RequestedReason ,
584585 condition .SeverityInfo ,
585- fmt . Sprintf ( condition .TLSInputReadyWaitingMessage , err .Error () )))
586+ condition .TLSInputReadyWaitingMessage , err .Error ()))
586587 return ctrl.Result {}, nil
587588 }
588589 instance .Status .Conditions .Set (condition .FalseCondition (
@@ -1365,7 +1366,7 @@ func (r *NeutronAPIReconciler) transportURLDeleted(
13651366 },
13661367 }
13671368
1368- err := r .Client . Delete (ctx , transportURL )
1369+ err := r .Delete (ctx , transportURL )
13691370 if err != nil {
13701371 if k8s_errors .IsNotFound (err ) {
13711372 return nil
@@ -1761,7 +1762,7 @@ func (r *NeutronAPIReconciler) generateServiceSecrets(
17611762 cmLabels := labels .GetLabels (instance , labels .GetGroupLabel (neutronapi .ServiceName ), map [string ]string {})
17621763
17631764 var tlsCfg * tls.Service
1764- if instance .Spec .TLS .Ca . CaBundleSecretName != "" {
1765+ if instance .Spec .TLS .CaBundleSecretName != "" {
17651766 tlsCfg = & tls.Service {}
17661767 }
17671768 // customData hold any customization for the service.
@@ -1958,7 +1959,7 @@ func (r *NeutronAPIReconciler) memcachedNamespaceMapFunc(ctx context.Context) ha
19581959 listOpts := []client.ListOption {
19591960 client .InNamespace (o .GetNamespace ()),
19601961 }
1961- if err := r .Client . List (context .Background (), neutrons , listOpts ... ); err != nil {
1962+ if err := r .List (context .Background (), neutrons , listOpts ... ); err != nil {
19621963 Log .Error (err , "Unable to retrieve Neutron CRs %w" )
19631964 return nil
19641965 }
0 commit comments