File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,16 +89,24 @@ func TLSCertificateGeneratorWithOwner(owner []metav1.OwnerReference) TLSCertific
8989}
9090
9191// TLSCertificateGeneratorWithServerSecretName returns an TLSCertificateGeneratorOption that sets server secret name.
92+ // If the secret name is empty, the option is a no-op.
9293func TLSCertificateGeneratorWithServerSecretName (s string , dnsNames []string ) TLSCertificateGeneratorOption {
9394 return func (g * TLSCertificateGenerator ) {
95+ if s == "" {
96+ return
97+ }
9498 g .tlsServerSecretName = & s
9599 g .tlsServerDNSNames = dnsNames
96100 }
97101}
98102
99103// TLSCertificateGeneratorWithClientSecretName returns an TLSCertificateGeneratorOption that sets client secret name.
104+ // If the secret name is empty, the option is a no-op.
100105func TLSCertificateGeneratorWithClientSecretName (s string , subjects []string ) TLSCertificateGeneratorOption {
101106 return func (g * TLSCertificateGenerator ) {
107+ if s == "" {
108+ return
109+ }
102110 g .tlsClientSecretName = & s
103111 g .tlsClientDNSNames = subjects
104112 }
You can’t perform that action at this time.
0 commit comments