Skip to content

Commit

Permalink
Merge pull request #835 from emosbaugh/omit-empty-hostname-in-kotsadm…
Browse files Browse the repository at this point in the history
…-tls-secret

Omit empty hostname from kotsadm-tls secret
  • Loading branch information
emosbaugh committed Jul 23, 2020
2 parents a64f3e6 + 70714ef commit b85733b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions kotsadm/kurl_proxy/cmd/main.go
Expand Up @@ -270,7 +270,9 @@ func getHttpsServer(upstream *url.URL, tlsSecretName string, secrets corev1.Secr
if len(secret.StringData) == 0 {
secret.StringData = make(map[string]string)
}
secret.StringData["hostname"] = hostString
if hostString != "" {
secret.StringData["hostname"] = hostString
}

if secret.Type == "Opaque" {
// Old version version of secret was type 'Opaque'
Expand Down Expand Up @@ -343,7 +345,9 @@ func getHttpsServer(upstream *url.URL, tlsSecretName string, secrets corev1.Secr
if len(secret.StringData) == 0 {
secret.StringData = make(map[string]string)
}
secret.StringData["hostname"] = hostString
if hostString != "" {
secret.StringData["hostname"] = hostString
}

if secret.Type == "Opaque" {
// Old version version of secret was type 'Opaque'
Expand Down

0 comments on commit b85733b

Please sign in to comment.