rename some certificate validation tests and test explicit default group
Signed-off-by: Ashley Davis <ashley.davis@venafi.com>
This commit is contained in:
parent
d466fa2a6d
commit
01cf2d4155
@ -77,7 +77,7 @@ func TestValidateCertificate(t *testing.T) {
|
||||
},
|
||||
a: someAdmissionRequest,
|
||||
},
|
||||
"valid with blank issuerRef kind": {
|
||||
"valid with blank issuerRef kind and no group": {
|
||||
cfg: &internalcmapi.Certificate{
|
||||
Spec: internalcmapi.CertificateSpec{
|
||||
CommonName: "testcn",
|
||||
@ -89,7 +89,7 @@ func TestValidateCertificate(t *testing.T) {
|
||||
},
|
||||
a: someAdmissionRequest,
|
||||
},
|
||||
"valid with 'Issuer' issuerRef kind": {
|
||||
"valid with 'Issuer' issuerRef kind and no group": {
|
||||
cfg: &internalcmapi.Certificate{
|
||||
Spec: internalcmapi.CertificateSpec{
|
||||
CommonName: "testcn",
|
||||
@ -115,6 +115,20 @@ func TestValidateCertificate(t *testing.T) {
|
||||
},
|
||||
a: someAdmissionRequest,
|
||||
},
|
||||
"valid with 'Issuer' issuerRef kind and explicit internal group": {
|
||||
cfg: &internalcmapi.Certificate{
|
||||
Spec: internalcmapi.CertificateSpec{
|
||||
CommonName: "testcn",
|
||||
SecretName: "abc",
|
||||
IssuerRef: cmmeta.ObjectReference{
|
||||
Name: "valid",
|
||||
Kind: "Issuer",
|
||||
Group: "cert-manager.io",
|
||||
},
|
||||
},
|
||||
},
|
||||
a: someAdmissionRequest,
|
||||
},
|
||||
"invalid issuerRef kind": {
|
||||
cfg: &internalcmapi.Certificate{
|
||||
Spec: internalcmapi.CertificateSpec{
|
||||
@ -168,7 +182,7 @@ func TestValidateCertificate(t *testing.T) {
|
||||
field.Invalid(fldPath, "", "at least one of commonName (from the commonName field or from a literalSubject), dnsNames, uriSANs, ipAddresses, emailSANs or otherNames must be set"),
|
||||
},
|
||||
},
|
||||
"certificate with no issuerRef": {
|
||||
"invalid with no issuerRef": {
|
||||
cfg: &internalcmapi.Certificate{
|
||||
Spec: internalcmapi.CertificateSpec{
|
||||
CommonName: "testcn",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user