Allow cert-manager.io/allow-direct-injection in annotations
Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de>
This commit is contained in:
parent
7155520dbc
commit
818df603f5
@ -282,7 +282,7 @@ func validateSecretTemplateAnnotations(crt *internalcmapi.CertificateSpec, fldPa
|
||||
|
||||
secretTemplateAnnotationsPath := fldPath.Child("secretTemplate", "annotations")
|
||||
for a := range crt.SecretTemplate.Annotations {
|
||||
if strings.HasPrefix(a, "cert-manager.io/") {
|
||||
if strings.HasPrefix(a, "cert-manager.io/") && a != "cert-manager.io/allow-direct-injection" {
|
||||
el = append(el, field.Invalid(secretTemplateAnnotationsPath, a, "cert-manager.io/* annotations are not allowed"))
|
||||
}
|
||||
}
|
||||
|
||||
@ -635,9 +635,10 @@ func TestValidateCertificate(t *testing.T) {
|
||||
SecretName: "abc",
|
||||
SecretTemplate: &internalcmapi.CertificateSecretTemplate{
|
||||
Annotations: map[string]string{
|
||||
"app.com/valid": "valid",
|
||||
"cert-manager.io/alt-names": "example.com",
|
||||
"cert-manager.io/certificate-name": "selfsigned-cert",
|
||||
"app.com/valid": "valid",
|
||||
"cert-manager.io/alt-names": "example.com",
|
||||
"cert-manager.io/certificate-name": "selfsigned-cert",
|
||||
"cert-manager.io/allow-direct-injection": "true",
|
||||
},
|
||||
},
|
||||
IssuerRef: cmmeta.ObjectReference{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user