mirror of
https://github.com/flant/ovpn-admin.git
synced 2026-02-04 01:10:22 -08:00
Compare commits
2 Commits
340f401bb3
...
68b7d80c70
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68b7d80c70 | ||
|
|
b85931184d |
@ -230,6 +230,16 @@ func (openVPNPKI *OpenVPNPKI) indexTxtUpdate() (err error) {
|
|||||||
|
|
||||||
log.Trace(cert.Subject.CommonName)
|
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"] == "" {
|
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"])
|
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()) {
|
} else if cert.NotAfter.Before(time.Now()) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user