@@ -66,11 +66,11 @@ func TestRenewalTime(t *testing.T) {
6666 renewBefore : & metav1.Duration {Duration : time .Hour * 25 },
6767 expectedRenewalTime : & metav1.Time {Time : now .Add (time .Hour * 16 )},
6868 },
69- "long lived cert, spec.renewBeforePercentage is set to renew 50% of the way " : {
69+ "long lived cert, spec.renewBeforePercentage is set to renew 30% before expiry " : {
7070 notBefore : now ,
7171 notAfter : now .Add (time .Hour * 730 ), // 1 month
72- renewBeforePct : ptr .To (int32 (50 )),
73- expectedRenewalTime : & metav1.Time {Time : now .Add (time .Hour * 365 )},
72+ renewBeforePct : ptr .To (int32 (30 )),
73+ expectedRenewalTime : & metav1.Time {Time : now .Add (time .Hour * 511 )}, // 70% of 1 month
7474 },
7575 // This test case is here to show the scenario where users set
7676 // renewBefore to very slightly less than actual duration. This
@@ -115,7 +115,7 @@ func TestRenewBefore(t *testing.T) {
115115 },
116116 "spec.renewBeforePercentage is valid" : {
117117 renewBeforePct : ptr .To (int32 (25 )),
118- expectedRenewBefore : 135 * time .Minute ,
118+ expectedRenewBefore : 45 * time .Minute ,
119119 },
120120 "spec.renewBeforePercentage is too large so default is used" : {
121121 renewBeforePct : ptr .To (int32 (100 )),
0 commit comments