mirror of https://github.com/linkerd/linkerd2.git
nit: return crtExpiry even for External Certs (#5173)
This change updates `FetchExternalIssuerData` to be more like `FetchIssuerData` and return expiry correctly. This field is currently not used anywhere and is just done for consistentcy purposes. Signed-off-by: Tarun Pothulapati <tarunpothulapati@outlook.com>
This commit is contained in:
parent
4d85b6cd65
commit
d9a6e217f9
|
@ -74,7 +74,12 @@ func FetchExternalIssuerData(ctx context.Context, api kubernetes.Interface, cont
|
||||||
return nil, fmt.Errorf(keyMissingError, corev1.TLSPrivateKeyKey, "issuer key", k8s.IdentityIssuerSecretName, true)
|
return nil, fmt.Errorf(keyMissingError, corev1.TLSPrivateKeyKey, "issuer key", k8s.IdentityIssuerSecretName, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &IssuerCertData{string(anchors), string(crt), string(key), nil}, nil
|
cert, err := tls.DecodePEMCrt(string(crt))
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("could not parse issuer certificate: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
return &IssuerCertData{string(anchors), string(crt), string(key), &cert.Certificate.NotAfter}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// LoadIssuerCrtAndKeyFromFiles loads the issuer certificate and key from files
|
// LoadIssuerCrtAndKeyFromFiles loads the issuer certificate and key from files
|
||||||
|
|
Loading…
Reference in New Issue