Skip to content

Commit cb8a115

Browse files
committed
fix: r
Signed-off-by: ashing <[email protected]>
1 parent 6b5add7 commit cb8a115

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

internal/provider/adc/translator/gateway.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,16 @@ func (t *Translator) translateSecret(tctx *provider.TranslateContext, listener g
8585
// Dashboard doesn't allow wildcard hostname
8686
if listener.Hostname != nil && *listener.Hostname != "" {
8787
sslObj.Snis = append(sslObj.Snis, string(*listener.Hostname))
88-
} else {
89-
hosts, err := extractHost(cert)
90-
if err != nil {
91-
return nil, err
92-
}
93-
sslObj.Snis = append(sslObj.Snis, hosts...)
9488
}
95-
if len(sslObj.Snis) == 0 {
89+
hosts, err := extractHost(cert)
90+
if err != nil {
91+
return nil, err
92+
}
93+
if len(hosts) == 0 {
9694
log.Warnw("no valid hostname found in certificate", zap.String("secret", secret.Namespace+"/"+secret.Name))
9795
continue
9896
}
97+
sslObj.Snis = append(sslObj.Snis, hosts...)
9998
// Note: Dashboard doesn't allow duplicate certificate across ssl objects
10099
sslObj.ID = id.GenID(string(cert))
101100
sslObj.Labels = label.GenLabel(obj)

0 commit comments

Comments
 (0)