Skip to content

Commit

Permalink
Merge pull request #138 from Miciah/use-generateCertKey-consistently
Browse files Browse the repository at this point in the history
Use generateCertKey consistently
  • Loading branch information
openshift-merge-robot committed Jul 10, 2020
2 parents 67c08c8 + 79090f0 commit cb4650f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion pkg/router/template/router.go
Expand Up @@ -1094,7 +1094,8 @@ func (r *templateRouter) SyncedAtLeastOnce() bool {
// hasRequiredEdgeCerts ensures that at least a host certificate and key are provided.
// a ca cert is not required because it may be something that is in the root cert chain
func hasRequiredEdgeCerts(cfg *ServiceAliasConfig) bool {
hostCert, ok := cfg.Certificates[cfg.Host]
certKey := generateCertKey(cfg)
hostCert, ok := cfg.Certificates[certKey]
return ok && len(hostCert.Contents) > 0 && len(hostCert.PrivateKey) > 0
}

Expand Down
3 changes: 2 additions & 1 deletion pkg/router/template/template_helper.go
Expand Up @@ -168,7 +168,8 @@ func generateHAProxyCertConfigMap(td templateData) []string {
for k, cfg := range td.State {
hascert := false
if len(cfg.Host) > 0 {
cert, ok := cfg.Certificates[cfg.Host]
certKey := generateCertKey(&cfg)
cert, ok := cfg.Certificates[certKey]
hascert = ok && len(cert.Contents) > 0
}

Expand Down

0 comments on commit cb4650f

Please sign in to comment.