mirror of
https://github.com/flant/ovpn-admin.git
synced 2026-02-04 01:10:22 -08:00
Merge b85931184da1c5f2f8a96163f74e899b2a0a2275 into a781600f13db10cf07b7bf2305fd55ef34be49fb
This commit is contained in:
commit
a1256090bd
@ -230,6 +230,16 @@ func (openVPNPKI *OpenVPNPKI) indexTxtUpdate() (err error) {
|
||||
|
||||
log.Trace(cert.Subject.CommonName)
|
||||
|
||||
// Fix for old secrets, added label name if not exists
|
||||
labelName := secret.Labels["name"]
|
||||
if labelName == "" {
|
||||
secret.Labels["name"] = cert.Subject.CommonName
|
||||
_, err = openVPNPKI.KubeClient.CoreV1().Secrets(namespace).Update(context.TODO(), &secret, metav1.UpdateOptions{})
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
if secret.Annotations["revokedAt"] == "" {
|
||||
indexTxt += fmt.Sprintf("%s\t%s\t\t%s\t%s\t%s\n", "V", cert.NotAfter.Format(indexTxtDateFormat), fmt.Sprintf("%d", cert.SerialNumber), "unknown", "/CN="+secret.Labels["name"])
|
||||
} else if cert.NotAfter.Before(time.Now()) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user