Update tests to support multiple orgs

Signed-off-by: Max Ehrlich <max.ehr@gmail.com>
This commit is contained in:
Max Ehrlich 2018-09-05 15:43:48 -04:00
parent 6a9f1d2348
commit fc8167581f
No known key found for this signature in database
GPG Key ID: 439AC62D3C8A495A
3 changed files with 4 additions and 4 deletions

View File

@ -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"))
}

View File

@ -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": {

View File

@ -78,7 +78,7 @@ func TestValidateCertificate(t *testing.T) {
Spec: v1alpha1.CertificateSpec{
CommonName: "testcn",
SecretName: "abc",
Organization: "testorg",
Organization: []string{"testorg"},
IssuerRef: validIssuerRef,
},
},