@@ -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 Kubernetes controllers for managing Placement API components
1718package controllers
1819
1920import (
@@ -71,6 +72,7 @@ type conditionUpdater interface {
7172 MarkTrue (t condition.Type , messageFormat string , messageArgs ... interface {})
7273}
7374
75+ // GetSecret interface defines methods for objects that can provide secret names
7476type GetSecret interface {
7577 GetSecret () string
7678 client.Object
@@ -93,7 +95,7 @@ func ensureSecret(
9395 condition .InputReadyCondition ,
9496 condition .RequestedReason ,
9597 condition .SeverityInfo ,
96- fmt .Sprintf ("Input data resources missing: %s" , "secret/" + secretName .Name )))
98+ "%s" , fmt .Sprintf ("Input data resources missing: %s" , "secret/" + secretName .Name )))
9799 return "" ,
98100 ctrl.Result {},
99101 * secret ,
@@ -141,7 +143,7 @@ func ensureSecret(
141143 return hash , ctrl.Result {}, * secret , nil
142144}
143145
144- // GetLog returns a logger object with a prefix of "controller.name" and additional controller context fields
146+ // GetLogger returns a logger object with a prefix of "controller.name" and additional controller context fields
145147func (r * PlacementAPIReconciler ) GetLogger (ctx context.Context ) logr.Logger {
146148 return log .FromContext (ctx ).WithName ("Controllers" ).WithName ("PlacementAPI" )
147149}
@@ -186,7 +188,7 @@ func (r *PlacementAPIReconciler) Reconcile(ctx context.Context, req ctrl.Request
186188
187189 // Fetch the PlacementAPI instance
188190 instance := & placementv1.PlacementAPI {}
189- err := r .Client . Get (ctx , req .NamespacedName , instance )
191+ err := r .Get (ctx , req .NamespacedName , instance )
190192 if err != nil {
191193 if k8s_errors .IsNotFound (err ) {
192194 // Request object not found, could have been deleted after reconcile request.
@@ -386,7 +388,7 @@ func (r *PlacementAPIReconciler) Reconcile(ctx context.Context, req ctrl.Request
386388 condition .TLSInputReadyCondition ,
387389 condition .RequestedReason ,
388390 condition .SeverityInfo ,
389- fmt . Sprintf ( condition .TLSInputReadyWaitingMessage , instance .Spec .TLS .CaBundleSecretName ) ))
391+ condition .TLSInputReadyWaitingMessage , instance .Spec .TLS .CaBundleSecretName ))
390392 return ctrl.Result {}, nil
391393 }
392394 instance .Status .Conditions .Set (condition .FalseCondition (
@@ -411,7 +413,7 @@ func (r *PlacementAPIReconciler) Reconcile(ctx context.Context, req ctrl.Request
411413 condition .TLSInputReadyCondition ,
412414 condition .RequestedReason ,
413415 condition .SeverityInfo ,
414- fmt . Sprintf ( condition .TLSInputReadyWaitingMessage , err .Error () )))
416+ condition .TLSInputReadyWaitingMessage , err .Error ()))
415417 return ctrl.Result {}, nil
416418 }
417419 instance .Status .Conditions .Set (condition .FalseCondition (
@@ -980,7 +982,7 @@ func (r *PlacementAPIReconciler) findObjectForSrc(ctx context.Context, src clien
980982 listOps := & client.ListOptions {
981983 Namespace : src .GetNamespace (),
982984 }
983- err := r .Client . List (ctx , crList , listOps )
985+ err := r .List (ctx , crList , listOps )
984986 if err != nil {
985987 Log .Error (err , fmt .Sprintf ("listing %s for namespace: %s" , crList .GroupVersionKind ().Kind , src .GetNamespace ()))
986988 return requests
@@ -1322,7 +1324,7 @@ func (r *PlacementAPIReconciler) generateServiceConfigMaps(
13221324 cmLabels := labels .GetLabels (instance , labels .GetGroupLabel (placement .ServiceName ), map [string ]string {})
13231325
13241326 var tlsCfg * tls.Service
1325- if instance .Spec .TLS .Ca . CaBundleSecretName != "" {
1327+ if instance .Spec .TLS .CaBundleSecretName != "" {
13261328 tlsCfg = & tls.Service {}
13271329 }
13281330
0 commit comments