mirror of
https://github.com/wahyd4/cert-manager.git
synced 2026-08-19 10:09:13 +10:00
Adds a URISANs e2e conformance test
Signed-off-by: JoshVanL <vleeuwenjoshua@gmail.com>
This commit is contained in:
@@ -38,6 +38,7 @@ var _ = framework.ConformanceDescribe("Certificates", func() {
|
||||
certificates.IPAddressFeature,
|
||||
certificates.DurationFeature,
|
||||
certificates.WildcardsFeature,
|
||||
certificates.URISANsFeature,
|
||||
)
|
||||
|
||||
// unsupportedDNS01Features is a list of features that are not supported by the ACME
|
||||
@@ -45,6 +46,7 @@ var _ = framework.ConformanceDescribe("Certificates", func() {
|
||||
var unsupportedDNS01Features = certificates.NewFeatureSet(
|
||||
certificates.IPAddressFeature,
|
||||
certificates.DurationFeature,
|
||||
certificates.URISANsFeature,
|
||||
)
|
||||
|
||||
provisionerHTTP01 := new(acmeIssuerProvisioner)
|
||||
|
||||
@@ -98,4 +98,8 @@ const (
|
||||
// certificates for the same private key. This is useful for some issuers
|
||||
// that have trouble being configured to support this feature.
|
||||
ReusePrivateKeyFeature Feature = "ReusePrivateKey"
|
||||
|
||||
// URISANs denotes whether to the target issuer is able to sign a certificate
|
||||
// that includes a URISANs. ACME providers do not support this.
|
||||
URISANsFeature Feature = "URISANs"
|
||||
)
|
||||
|
||||
@@ -252,6 +252,34 @@ func (s *Suite) Define() {
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
})
|
||||
|
||||
It("should issue a certificate that includes only a URISANs name", func() {
|
||||
s.checkFeatures(URISANsFeature)
|
||||
|
||||
testCertificate := &cmapi.Certificate{
|
||||
ObjectMeta: metav1.ObjectMeta{
|
||||
Name: "testcert",
|
||||
Namespace: f.Namespace.Name,
|
||||
},
|
||||
Spec: cmapi.CertificateSpec{
|
||||
SecretName: "testcert-tls",
|
||||
URISANs: []string{
|
||||
"spiffe://cluster.local/ns/sandbox/sa/foo",
|
||||
},
|
||||
IssuerRef: issuerRef,
|
||||
},
|
||||
}
|
||||
By("Creating a Certificate")
|
||||
err := f.CRClient.Create(ctx, testCertificate)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
By("Waiting for the Certificate to be issued...")
|
||||
err = f.Helper().WaitCertificateIssuedValid(f.Namespace.Name, "testcert", time.Minute*5)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
|
||||
err = f.Helper().WaitCertificateIssuedValid(f.Namespace.Name, "testcert", time.Minute*5)
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
})
|
||||
|
||||
It("should issue another certificate with the same private key if the existing certificate and CertificateRequest are deleted", func() {
|
||||
s.checkFeatures(ReusePrivateKeyFeature)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user