Skip to content

Commit 8bb7aa9

Browse files
committed
fix golangci reported issuers
Signed-off-by: Martin Schuppert <[email protected]>
1 parent d13f74c commit 8bb7aa9

File tree

9 files changed

+22
-15
lines changed

9 files changed

+22
-15
lines changed

api/v1beta1/keystoneapi_webhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func (spec *KeystoneAPISpec) ValidateUpdate(old KeystoneAPISpec, basePath *field
151151
return spec.KeystoneAPISpecCore.ValidateUpdate(old.KeystoneAPISpecCore, basePath)
152152
}
153153

154-
func (spec *KeystoneAPISpecCore) ValidateUpdate(old KeystoneAPISpecCore, basePath *field.Path) field.ErrorList {
154+
func (spec *KeystoneAPISpecCore) ValidateUpdate(_ KeystoneAPISpecCore, basePath *field.Path) field.ErrorList {
155155
var allErrs field.ErrorList
156156

157157
// validate the service override key is valid

api/v1beta1/keystoneendpoint.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,5 @@ func GetKeystoneEndpointUrls(
239239
}
240240
}
241241

242-
243242
return endpointurls, nil
244243
}

controllers/keystoneapi_controller.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,8 @@ func (r *KeystoneAPIReconciler) reconcileNormal(
887887
condition.TLSInputReadyCondition,
888888
condition.RequestedReason,
889889
condition.SeverityInfo,
890-
fmt.Sprintf(condition.TLSInputReadyWaitingMessage, instance.Spec.TLS.CaBundleSecretName)))
890+
condition.TLSInputReadyWaitingMessage,
891+
instance.Spec.TLS.CaBundleSecretName))
891892
return ctrl.Result{}, nil
892893
}
893894
instance.Status.Conditions.Set(condition.FalseCondition(
@@ -912,7 +913,8 @@ func (r *KeystoneAPIReconciler) reconcileNormal(
912913
condition.TLSInputReadyCondition,
913914
condition.RequestedReason,
914915
condition.SeverityInfo,
915-
fmt.Sprintf(condition.TLSInputReadyWaitingMessage, err.Error())))
916+
condition.TLSInputReadyWaitingMessage,
917+
err.Error()))
916918
return ctrl.Result{}, nil
917919
}
918920
instance.Status.Conditions.Set(condition.FalseCondition(

pkg/keystone/bootstrap.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func BootstrapJob(
117117
}
118118
job.Spec.Template.Spec.Containers[0].Env = env.MergeEnvs(job.Spec.Template.Spec.Containers[0].Env, envVars)
119119

120-
if instance.Spec.NodeSelector != nil && len(instance.Spec.NodeSelector) > 0 {
120+
if len(instance.Spec.NodeSelector) > 0 {
121121
job.Spec.Template.Spec.NodeSelector = instance.Spec.NodeSelector
122122
}
123123

pkg/keystone/cloudconfig.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,17 @@ type OpenStackConfigSecret struct {
5050
func GenerateCloudrc(secret *OpenStackConfigSecret, config *OpenStackConfig) string {
5151
auth := config.Clouds.Default.Auth
5252
val := fmt.Sprintf(
53-
"export OS_AUTH_URL=" + auth.AuthURL +
54-
"\nexport OS_USERNAME=" + auth.UserName +
55-
"\nexport OS_PROJECT_NAME=" + auth.ProjectName +
56-
"\nexport OS_PROJECT_DOMAIN_NAME=" + auth.ProjectDomainName +
57-
"\nexport OS_USER_DOMAIN_NAME=" + auth.UserDomainName +
58-
"\nexport OS_PASSWORD=" + secret.Clouds.Default.Auth.Password)
53+
"export OS_AUTH_URL=%s"+
54+
"\nexport OS_USERNAME=%s"+
55+
"\nexport OS_PROJECT_NAME=%s"+
56+
"\nexport OS_PROJECT_DOMAIN_NAME=%s"+
57+
"\nexport OS_USER_DOMAIN_NAME=%s"+
58+
"\nexport OS_PASSWORD=%s",
59+
auth.AuthURL,
60+
auth.UserName,
61+
auth.ProjectName,
62+
auth.ProjectDomainName,
63+
auth.UserDomainName,
64+
secret.Clouds.Default.Auth.Password)
5965
return val
6066
}

pkg/keystone/cronjob.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func CronJob(
9898
},
9999
},
100100
}
101-
if instance.Spec.NodeSelector != nil && len(instance.Spec.NodeSelector) > 0 {
101+
if len(instance.Spec.NodeSelector) > 0 {
102102
cronjob.Spec.JobTemplate.Spec.Template.Spec.NodeSelector = instance.Spec.NodeSelector
103103
}
104104

pkg/keystone/dbsync.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func DbSyncJob(
8989
},
9090
}
9191

92-
if instance.Spec.NodeSelector != nil && len(instance.Spec.NodeSelector) > 0 {
92+
if len(instance.Spec.NodeSelector) > 0 {
9393
job.Spec.Template.Spec.NodeSelector = instance.Spec.NodeSelector
9494
}
9595

pkg/keystone/deployment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func Deployment(
158158
},
159159
corev1.LabelHostname,
160160
)
161-
if instance.Spec.NodeSelector != nil && len(instance.Spec.NodeSelector) > 0 {
161+
if len(instance.Spec.NodeSelector) > 0 {
162162
deployment.Spec.Template.Spec.NodeSelector = instance.Spec.NodeSelector
163163
}
164164

tests/functional/keystoneapi_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ var _ = Describe("Keystone controller", func() {
11881188

11891189
mariadbSuite.RunBasicSuite()
11901190

1191-
mariadbSuite.RunURLAssertSuite(func(accountName types.NamespacedName, username string, password string) {
1191+
mariadbSuite.RunURLAssertSuite(func(_ types.NamespacedName, username string, password string) {
11921192
Eventually(func(g Gomega) {
11931193
scrt := th.GetSecret(keystoneAPIConfigDataName)
11941194
configData := string(scrt.Data["keystone.conf"])

0 commit comments

Comments
 (0)