Skip to content

Commit

Permalink
Omit empty hostname from kotsadm-tls secret
Browse files Browse the repository at this point in the history
  • Loading branch information
emosbaugh committed Jul 22, 2020
1 parent 1a2fed1 commit 70714ef
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 70714ef

Please sign in to comment.