Skip to content

Commit a307de4

Browse files
committed
address comments
1 parent cb9fa9d commit a307de4

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

cmd/nginx-ingress/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ func processDefaultServerSecret(ctx context.Context, kubeClient *kubernetes.Clie
572572
}
573573

574574
bytes := configs.GenerateCertAndKeyFileContent(secret)
575-
nginxManager.CreateSecret(configs.DefaultServerFileName, bytes, nginx.TLSSecretFileMode)
575+
nginxManager.CreateSecret(configs.DefaultServerSecretFileName, bytes, nginx.TLSSecretFileMode)
576576
} else {
577577
_, err := os.Stat(configs.DefaultServerSecretPath)
578578
if err != nil {
@@ -596,7 +596,7 @@ func processWildcardSecret(ctx context.Context, kubeClient *kubernetes.Clientset
596596
}
597597

598598
bytes := configs.GenerateCertAndKeyFileContent(secret)
599-
nginxManager.CreateSecret(configs.WildcardFileName, bytes, nginx.TLSSecretFileMode)
599+
nginxManager.CreateSecret(configs.WildcardSecretFileName, bytes, nginx.TLSSecretFileMode)
600600
}
601601
return *wildcardTLSSecret != ""
602602
}

internal/configs/configurator.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ const DefaultServerSecretPath = "/etc/nginx/secrets/default" //nolint:gosec // G
4747
// DefaultSecretPath is the full default path to where secrets are stored and accessed.
4848
const DefaultSecretPath = "/etc/nginx/secrets" // #nosec G101
4949

50-
// DefaultServerFileName is the filename of the Secret with a TLS cert and a key for the default server.
51-
const DefaultServerFileName = "default"
50+
// DefaultServerSecretFileName is the filename of the Secret with a TLS cert and a key for the default server.
51+
const DefaultServerSecretFileName = "default"
5252

53-
// WildcardFileName is the filename of the Secret with a TLS cert and a key for the ingress resources with TLS termination enabled but not secret defined.
54-
const WildcardFileName = "wildcard"
53+
// WildcardSecretFileName is the filename of the Secret with a TLS cert and a key for the ingress resources with TLS termination enabled but not secret defined.
54+
const WildcardSecretFileName = "wildcard"
5555

5656
// JWTKeyKey is the key of the data field of a Secret where the JWK must be stored.
5757
const JWTKeyKey = "jwk"

internal/k8s/controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,9 +1780,9 @@ func (lbc *LoadBalancerController) handleSpecialSecretUpdate(secret *api_v1.Secr
17801780
secretNsName := secret.Namespace + "/" + secret.Name
17811781
switch secretNsName {
17821782
case lbc.specialSecrets.defaultServerSecret:
1783-
lbc.validationTLSSpecialSecret(secret, configs.DefaultServerFileName, &specialTLSSecretsToUpdate)
1783+
lbc.validationTLSSpecialSecret(secret, configs.DefaultServerSecretFileName, &specialTLSSecretsToUpdate)
17841784
case lbc.specialSecrets.wildcardTLSSecret:
1785-
lbc.validationTLSSpecialSecret(secret, configs.WildcardFileName, &specialTLSSecretsToUpdate)
1785+
lbc.validationTLSSpecialSecret(secret, configs.WildcardSecretFileName, &specialTLSSecretsToUpdate)
17861786
default:
17871787
nl.Warnf(lbc.Logger, "special secret not found")
17881788
return

0 commit comments

Comments
 (0)