E58C Fix error msg to comply with a Go linter (#5582) · nginx/kubernetes-ingress@202b3d6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 202b3d6

Browse files
authored
Fix error msg to comply with a Go linter (#5582)
1 parent 39b6695 commit 202b3d6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/k8s/secrets/validation.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,10 @@ func ValidateCASecret(secret *api_v1.Secret) error {
7878

7979
block, _ := pem.Decode(secret.Data[CAKey])
8080
if block == nil {
81-
return fmt.Errorf("The data field %s must hold a valid CERTIFICATE PEM block", CAKey)
81+
return fmt.Errorf("the data field %s must hold a valid CERTIFICATE PEM block", CAKey)
8282
}
8383
if block.Type != "CERTIFICATE" {
84-
return fmt.Errorf("The data field %s must hold a valid CERTIFICATE PEM block, but got '%s'", CAKey, block.Type)
84+
return fmt.Errorf("the data field %s must hold a valid CERTIFICATE PEM block, but got '%s'", CAKey, block.Type)
8585
}
8686

8787
_, err := x509.ParseCertificate(block.Bytes)
@@ -112,11 +112,11 @@ func ValidateOIDCSecret(secret *api_v1.Secret) error {
112112
// ValidateHtpasswdSecret validates the secret. If it is valid, the function returns nil.
113113
func ValidateHtpasswdSecret(secret *api_v1.Secret) error {
114114
if secret.Type != SecretTypeHtpasswd {
115-
return fmt.Errorf("Htpasswd secret must be of the type %v", SecretTypeHtpasswd)
115+
return fmt.Errorf("htpasswd secret must be of the type %v", SecretTypeHtpasswd)
116116
}
117117

118118
if _, exists := secret.Data[HtpasswdFileKey]; !exists {
119-
return fmt.Errorf("Htpasswd secret must have the data field %v", HtpasswdFileKey)
119+
return fmt.Errorf("htpasswd secret must have the data field %v", HtpasswdFileKey)
120120
}
121121

122122
// we don't validate the contents of secret.Data[HtpasswdFileKey], because invalid contents will not make NGINX
@@ -149,7 +149,7 @@ func ValidateSecret(secret *api_v1.Secret) error {
149149
return ValidateHtpasswdSecret(secret)
150150
}
151151

152-
return fmt.Errorf("Secret is of the unsupported type %v", secret.Type)
152+
return fmt.Errorf("secret is of the unsupported type %v", secret.Type)
153153
}
154154

155155
var clientSecretValueFmtRegexp = regexp.MustCompile(`^([^"$\\\s]|\\[^$])*$`)

0 commit comments

Comments
 (0)
0