Fix nil map panic when writing to an empty existing Secret

Signed-off-by: James Munnelly <james@munnelly.eu>
This commit is contained in:
James Munnelly 2019-01-18 11:16:44 +00:00
parent 1a75d41429
commit 3d1183a169

View File

@ -299,6 +299,9 @@ func (c *Controller) updateSecret(crt *v1alpha1.Certificate, namespace string, c
}
}
if secret.Data == nil {
secret.Data = map[string][]byte{}
}
secret.Data[corev1.TLSCertKey] = cert
secret.Data[corev1.TLSPrivateKeyKey] = key
secret.Data[TLSCAKey] = ca