Skip to content
This repository has been archived by the owner on Aug 29, 2022. It is now read-only.

Commit

Permalink
add testcases for altnamesforpodallowunqualified
Browse files Browse the repository at this point in the history
  • Loading branch information
rajatjindal authored and johngmyers committed Mar 17, 2020
1 parent 437ff6a commit d341dbb
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions inspectors/altnamesforpod/altnamesforpod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,31 @@ func TestInspect(t *testing.T) {
},
expectMessage: "Subject Alt Name contains disallowed name: example.org",
},
{
name: "unqualified domain with altnamesforpod",
setupRequest: func(request *x509.CertificateRequest) {
request.DNSNames = []string{
"172-1-0-3.somenamespace.pod.cluster.local",
"tls-service.somenamespace.svc.cluster.local",
"tls-service.somenamespace.svc",
}
request.IPAddresses = makeIps("172.1.0.3", "10.0.0.1", "10.1.2.3", "10.1.2.4")
},
expectMessage: "Subject Alt Name contains disallowed name: tls-service.somenamespace.svc",
},
{
name: "unqualified domain with altnamesforpodallowunqualified",
setupRequest: func(request *x509.CertificateRequest) {
request.DNSNames = []string{
"172-1-0-3.somenamespace.pod.cluster.local",
"tls-service.somenamespace.svc.cluster.local",
"tls-service.somenamespace.svc",
}
request.IPAddresses = makeIps("172.1.0.3", "10.0.0.1", "10.1.2.3", "10.1.2.4")
},
inspectorName: "altnamesforpodallowunqualified",
expectMessage: "",
},
{
name: "ExtraIp",
setupRequest: func(request *x509.CertificateRequest) {
Expand Down

0 comments on commit d341dbb

Please sign in to comment.