@@ -64,12 +64,18 @@ import (
6464)
6565
6666const (
67- PKCS11PrepReadyCondition = "PKCS11PrepReady"
68- PKCS11PrepReadyInitMessage = "PKCS11 Prep job not started"
69- PKCS11PrepReadyMessage = "PKCS11 Prep job completed"
70- PKCS11PrepReadyErrorMessage = "PKCS11 Prep job error occurred %s"
67+ // PKCS11PrepReadyCondition indicates whether PKCS11 preparation is ready
68+ PKCS11PrepReadyCondition = "PKCS11PrepReady"
69+ // PKCS11PrepReadyInitMessage is the initial message for PKCS11 prep status
70+ PKCS11PrepReadyInitMessage = "PKCS11 Prep job not started"
71+ // PKCS11PrepReadyMessage is the message when PKCS11 prep job is completed
72+ PKCS11PrepReadyMessage = "PKCS11 Prep job completed"
73+ // PKCS11PrepReadyErrorMessage is the error message template for PKCS11 prep job failures
74+ PKCS11PrepReadyErrorMessage = "PKCS11 Prep job error occurred %s"
75+ // PKCS11PrepReadyRunningMessage is the message when PKCS11 prep job is still running
7176 PKCS11PrepReadyRunningMessage = "PKCS11 Prep job is still running"
72- PKCS11PrepReadyNotRunMessage = "PKCS11 Prep job not run"
77+ // PKCS11PrepReadyNotRunMessage is the message when PKCS11 prep job has not been run
78+ PKCS11PrepReadyNotRunMessage = "PKCS11 Prep job not run"
7379)
7480
7581// BarbicanReconciler reconciles a Barbican object
@@ -123,7 +129,7 @@ func (r *BarbicanReconciler) Reconcile(ctx context.Context, req ctrl.Request) (r
123129 Log := r .GetLogger (ctx )
124130
125131 instance := & barbicanv1beta1.Barbican {}
126- err := r .Client . Get (ctx , req .NamespacedName , instance )
132+ err := r .Get (ctx , req .NamespacedName , instance )
127133 if err != nil {
128134 if k8s_errors .IsNotFound (err ) {
129135 // Request object not found, could have been deleted after reconcile request.
@@ -551,13 +557,13 @@ func (r *BarbicanReconciler) reconcileDelete(ctx context.Context, instance *barb
551557// fields to index to reconcile when change
552558const (
553559 passwordSecretField = ".spec.secret"
554- caBundleSecretNameField = ".spec.tls.caBundleSecretName"
560+ caBundleSecretNameField = ".spec.tls.caBundleSecretName" // #nosec G101
555561 tlsAPIInternalField = ".spec.tls.api.internal.secretName"
556562 tlsAPIPublicField = ".spec.tls.api.public.secretName"
557- pkcs11LoginSecretField = ".spec.pkcs11.loginSecret"
558- pkcs11ClientDataSecretField = ".spec.pkcs11.clientDataSecret"
563+ pkcs11LoginSecretField = ".spec.pkcs11.loginSecret" // #nosec G101
564+ pkcs11ClientDataSecretField = ".spec.pkcs11.clientDataSecret" // #nosec G101
559565 topologyField = ".spec.topologyRef.Name"
560- customServiceConfigSecretsField = ".spec.customServiceConfigSecrets"
566+ customServiceConfigSecretsField = ".spec.customServiceConfigSecrets" // #nosec G101
561567 parentBarbicanConfigDataSecretField = ".status.parentBarbicanConfigDataSecret"
562568)
563569
@@ -623,7 +629,7 @@ func (r *BarbicanReconciler) findObjectForSrc(ctx context.Context, src client.Ob
623629 listOps := & client.ListOptions {
624630 Namespace : src .GetNamespace (),
625631 }
626- err := r .Client . List (ctx , crList , listOps )
632+ err := r .List (ctx , crList , listOps )
627633 if err != nil {
628634 Log .Error (err , fmt .Sprintf ("listing %s for namespace: %s" , crList .GroupVersionKind ().Kind , src .GetNamespace ()))
629635 return requests
@@ -670,7 +676,7 @@ func (r *BarbicanReconciler) generateServiceConfig(
670676 }
671677
672678 var tlsCfg * tls.Service
673- if instance .Spec .BarbicanAPI .TLS .Ca . CaBundleSecretName != "" {
679+ if instance .Spec .BarbicanAPI .TLS .CaBundleSecretName != "" {
674680 tlsCfg = & tls.Service {}
675681 }
676682 customData := map [string ]string {
@@ -816,7 +822,7 @@ func (r *BarbicanReconciler) apiDeploymentCreateOrUpdate(ctx context.Context, in
816822 }
817823
818824 // Note: The top-level .spec.apiTimeout ALWAYS overrides .spec.barbicanAPI.apiTimeout
819- apiSpec .BarbicanAPITemplate . APITimeout = instance .Spec .APITimeout
825+ apiSpec .APITimeout = instance .Spec .APITimeout
820826
821827 deployment := & barbicanv1beta1.BarbicanAPI {
822828 ObjectMeta : metav1.ObjectMeta {
@@ -1166,7 +1172,6 @@ func (r *BarbicanReconciler) ensureDB(
11661172 ctx , h , instance .Spec .DatabaseAccount ,
11671173 instance .Namespace , false , barbican .DatabaseUsernamePrefix ,
11681174 )
1169-
11701175 if err != nil {
11711176 instance .Status .Conditions .Set (condition .FalseCondition (
11721177 mariadbv1 .MariaDBAccountReadyCondition ,
@@ -1194,7 +1199,6 @@ func (r *BarbicanReconciler) ensureDB(
11941199
11951200 // create or patch the DB
11961201 ctrlResult , err := db .CreateOrPatchAll (ctx , h )
1197-
11981202 if err != nil {
11991203 instance .Status .Conditions .Set (condition .FalseCondition (
12001204 condition .DBReadyCondition ,
0 commit comments