@@ -50,7 +50,6 @@ import (
5050 "github.com/openstack-k8s-operators/lib-common/modules/common/env"
5151 "github.com/openstack-k8s-operators/lib-common/modules/common/helper"
5252 "github.com/openstack-k8s-operators/lib-common/modules/common/labels"
53- "github.com/openstack-k8s-operators/lib-common/modules/common/networkattachment"
5453 nad "github.com/openstack-k8s-operators/lib-common/modules/common/networkattachment"
5554 "github.com/openstack-k8s-operators/lib-common/modules/common/secret"
5655 service "github.com/openstack-k8s-operators/lib-common/modules/common/service"
@@ -220,7 +219,7 @@ func (r *SwiftProxyReconciler) Reconcile(ctx context.Context, req ctrl.Request)
220219 condition .TLSInputReadyCondition ,
221220 condition .RequestedReason ,
222221 condition .SeverityInfo ,
223- fmt . Sprintf ( condition .TLSInputReadyWaitingMessage , instance .Spec .TLS .CaBundleSecretName ) ))
222+ condition .TLSInputReadyWaitingMessage , instance .Spec .TLS .CaBundleSecretName ))
224223 return ctrl.Result {}, nil
225224 }
226225 instance .Status .Conditions .Set (condition .FalseCondition (
@@ -245,7 +244,7 @@ func (r *SwiftProxyReconciler) Reconcile(ctx context.Context, req ctrl.Request)
245244 condition .TLSInputReadyCondition ,
246245 condition .RequestedReason ,
247246 condition .SeverityInfo ,
248- fmt .Sprintf (condition .TLSInputReadyWaitingMessage , err .Error ())))
247+ "%s" , fmt .Sprintf (condition .TLSInputReadyWaitingMessage , err .Error ())))
249248 return ctrl.Result {}, nil
250249 }
251250 instance .Status .Conditions .Set (condition .FalseCondition (
@@ -609,7 +608,7 @@ func (r *SwiftProxyReconciler) Reconcile(ctx context.Context, req ctrl.Request)
609608 // networks to attach to
610609 nadList := []networkv1.NetworkAttachmentDefinition {}
611610 for _ , netAtt := range instance .Spec .NetworkAttachments {
612- nad , err := networkattachment .GetNADWithName (ctx , helper , netAtt , instance .Namespace )
611+ nad , err := nad .GetNADWithName (ctx , helper , netAtt , instance .Namespace )
613612 if err != nil {
614613 if apierrors .IsNotFound (err ) {
615614 instance .Status .Conditions .Set (condition .FalseCondition (
@@ -714,7 +713,7 @@ func (r *SwiftProxyReconciler) Reconcile(ctx context.Context, req ctrl.Request)
714713 if networkReady || * instance .Spec .Replicas == 0 {
715714 instance .Status .Conditions .MarkTrue (condition .NetworkAttachmentsReadyCondition , condition .NetworkAttachmentsReadyMessage )
716715 } else {
717- err := fmt .Errorf ("not all pods have interfaces with ips as configured in NetworkAttachments : %s" , instance .Spec .NetworkAttachments )
716+ err := fmt .Errorf ("%w : %s" , swift . ErrNetworkAttachmentsMismatch , instance .Spec .NetworkAttachments )
718717 instance .Status .Conditions .Set (condition .FalseCondition (
719718 condition .NetworkAttachmentsReadyCondition ,
720719 condition .ErrorReason ,
@@ -814,7 +813,7 @@ func (r *SwiftProxyReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Ma
814813 listOpts := []client.ListOption {
815814 client .InNamespace (o .GetNamespace ()),
816815 }
817- if err := r .Client . List (context .Background (), crList , listOpts ... ); err != nil {
816+ if err := r .List (context .Background (), crList , listOpts ... ); err != nil {
818817 Log .Error (err , "Unable to retrieve SwiftProxy CRs %w" )
819818 return nil
820819 }
@@ -902,7 +901,7 @@ func (r *SwiftProxyReconciler) findObjectForSrc(ctx context.Context, src client.
902901 listOps := & client.ListOptions {
903902 Namespace : src .GetNamespace (),
904903 }
905- err := r .Client . List (ctx , crList , listOps )
904+ err := r .List (ctx , crList , listOps )
906905 if err != nil {
907906 Log .Error (err , fmt .Sprintf ("listing %s for namespace: %s" , crList .GroupVersionKind ().Kind , src .GetNamespace ()))
908907 return requests
0 commit comments