adoroszlai commented on code in PR #4382:
URL: https://github.com/apache/ozone/pull/4382#discussion_r1133196421


##########
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/security/x509/certificate/client/DefaultCertificateClient.java:
##########
@@ -922,7 +922,7 @@ public Duration timeBeforeExpiryGracePeriod(X509Certificate 
certificate) {
     Duration gracePeriod = securityConfig.getRenewalGracePeriod();
     Date expireDate = certificate.getNotAfter();
     LocalDateTime gracePeriodStart = expireDate.toInstant()
-        .atZone(ZoneId.systemDefault()).toLocalDateTime().minus(gracePeriod);
+        .minus(gracePeriod).atZone(ZoneId.systemDefault()).toLocalDateTime();

Review Comment:
   Same logic appears in `CertificateClientTestImpl`, should be fixed there, 
too?
   
   
https://github.com/apache/ozone/blob/111161d78253e2afe920b14d2a14be282ea57e90/hadoop-hdds/framework/src/test/java/org/apache/hadoop/hdds/security/x509/certificate/client/CertificateClientTestImpl.java#L158-L159



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to