Skip to content

Commit

Permalink
Merge pull request #105397 from liggitt/automated-cherry-pick-of-#105…
Browse files Browse the repository at this point in the history
…396-upstream-release-1.22

Automated cherry pick of #105396: Fix CSR test to accept certs shorter than the requested
  • Loading branch information
k8s-ci-robot authored Oct 7, 2021
2 parents bd579ae + 407cc91 commit 58e2743
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/e2e/auth/certificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ var _ = SIGDescribe("Certificates API [Privileged:ClusterAdmin]", func() {
framework.ExpectNoError(err)
framework.ExpectEqual(len(certs), 1, "expected a single cert, got %#v", certs)
cert := certs[0]
framework.ExpectEqual(cert.NotAfter.Sub(cert.NotBefore), time.Hour+5*time.Minute, "unexpected cert duration: %s", dynamiccertificates.GetHumanCertDetail(cert))
// make sure the cert is not valid for longer than our requested time (plus allowance for backdating)
if e, a := time.Hour+5*time.Minute, cert.NotAfter.Sub(cert.NotBefore); a > e {
framework.Failf("expected cert valid for %s or less, got %s: %s", e, a, dynamiccertificates.GetHumanCertDetail(cert))
}

newClient, err := certificatesclient.NewForConfig(rcfg)
framework.ExpectNoError(err)
Expand Down

0 comments on commit 58e2743

Please sign in to comment.