Update tests to support multiple orgs
Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
This commit is contained in:
parent
6a9f1d2348
commit
fc8167581f
@ -59,7 +59,7 @@ func ValidateCertificateForACMEIssuer(crt *v1alpha1.CertificateSpec, issuer *v1a
|
||||
el = append(el, field.Invalid(specPath.Child("isCA"), crt.KeyAlgorithm, "ACME does not support CA certificates"))
|
||||
}
|
||||
|
||||
if crt.Organization != "" {
|
||||
if len(crt.Organization) != 0 {
|
||||
el = append(el, field.Invalid(specPath.Child("organization"), crt.Organization, "ACME does not support setting the organization name"))
|
||||
}
|
||||
|
||||
|
||||
@ -136,7 +136,7 @@ func TestValidateCertificateForIssuer(t *testing.T) {
|
||||
"acme certificate with organization set": {
|
||||
crt: &v1alpha1.Certificate{
|
||||
Spec: v1alpha1.CertificateSpec{
|
||||
Organization: "shouldfailorg",
|
||||
Organization: []string{"shouldfailorg"},
|
||||
IssuerRef: validIssuerRef,
|
||||
ACME: &v1alpha1.ACMECertificateConfig{
|
||||
Config: []v1alpha1.DomainSolverConfig{
|
||||
@ -155,7 +155,7 @@ func TestValidateCertificateForIssuer(t *testing.T) {
|
||||
Namespace: defaultTestNamespace,
|
||||
}),
|
||||
errs: []*field.Error{
|
||||
field.Invalid(fldPath.Child("organization"), "shouldfailorg", "ACME does not support setting the organization name"),
|
||||
field.Invalid(fldPath.Child("organization"), []string{"shouldfailorg"}, "ACME does not support setting the organization name"),
|
||||
},
|
||||
},
|
||||
"certificate with unspecified issuer type": {
|
||||
|
||||
@ -78,7 +78,7 @@ func TestValidateCertificate(t *testing.T) {
|
||||
Spec: v1alpha1.CertificateSpec{
|
||||
CommonName: "testcn",
|
||||
SecretName: "abc",
|
||||
Organization: "testorg",
|
||||
Organization: []string{"testorg"},
|
||||
IssuerRef: validIssuerRef,
|
||||
},
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user