Skip to content

Commit

Permalink
remove dns name from externalURL in tokencert
Browse files Browse the repository at this point in the history
Signed-off-by: Ziming Zhang <zziming@vmware.com>
  • Loading branch information
bitsf committed Nov 8, 2021
1 parent cbcfec0 commit 1565a88
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions controllers/goharbor/harbor/core.go
Expand Up @@ -231,11 +231,6 @@ func (r *Reconciler) GetCoreTokenCertificate(ctx context.Context, harbor *goharb
name := r.NormalizeName(ctx, harbor.GetName(), controllers.Core.String(), "tokencert")
namespace := harbor.GetNamespace()

publicDNS, err := url.Parse(harbor.Spec.ExternalURL)
if err != nil {
return nil, errors.Wrap(err, "cannot parse external url")
}

secretName := r.NormalizeName(ctx, harbor.GetName(), controllers.Core.String(), "tokencert")

return &certv1.Certificate{
Expand All @@ -247,11 +242,11 @@ func (r *Reconciler) GetCoreTokenCertificate(ctx context.Context, harbor *goharb
Duration: &metav1.Duration{
Duration: CoreTokenServiceDefaultCertificateDuration,
},
CommonName: secretName,
PrivateKey: &certv1.CertificatePrivateKey{
Algorithm: certv1.RSAKeyAlgorithm,
Size: CoreTokenServiceDefaultKeySize,
},
DNSNames: []string{publicDNS.Hostname()},
SecretName: secretName,
Usages: []certv1.KeyUsage{certv1.UsageSigning},
IssuerRef: harbor.Spec.Core.TokenIssuer,
Expand Down

0 comments on commit 1565a88

Please sign in to comment.