Skip to content

Commit

Permalink
[TLS] add SecretTemplate via EnsureCert
Browse files Browse the repository at this point in the history
This allows to pass in annotations and labels to be set on the
created secret holding the certificates

Jira: OSP-26299
  • Loading branch information
stuggi committed Oct 5, 2023
1 parent a921a2d commit 2b19dc9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/certmanager/certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ func EnsureCert(
certName string,
duration *time.Duration,
hostnames []string,
annotations map[string]string,
labels map[string]string,
) (*k8s_corev1.Secret, ctrl.Result, error) {
// get issuer
Expand Down Expand Up @@ -176,6 +177,10 @@ func EnsureCert(
Group: issuer.GroupVersionKind().Group,
},
SecretName: certSecretName,
SecretTemplate: &certmgrv1.CertificateSecretTemplate{
Annotations: annotations,
Labels: labels,
},
// TODO Usages, e.g. for client cert
},
)
Expand Down

0 comments on commit 2b19dc9

Please sign in to comment.