bharatviswa504 commented on a change in pull request #1958:
URL: https://github.com/apache/ozone/pull/1958#discussion_r582646261



##########
File path: 
hadoop-hdds/framework/src/main/java/org/apache/hadoop/hdds/security/x509/certificate/authority/DefaultCAServer.java
##########
@@ -252,23 +252,32 @@ private KeyPair getCAKeys() throws IOException {
   }
 
   private X509CertificateHolder signAndStoreCertificate(LocalDate beginDate,
-      LocalDate endDate, PKCS10CertificationRequest csr) throws IOException,
+      LocalDate endDate, PKCS10CertificationRequest csr, boolean scmCert)
+      throws IOException,
       OperatorCreationException, CertificateException {
     X509CertificateHolder xcert = approver.sign(config,
         getCAKeys().getPrivate(),
         getCACertificate(), java.sql.Date.valueOf(beginDate),
         java.sql.Date.valueOf(endDate), csr, scmID, clusterID);
-    store.storeValidCertificate(xcert.getSerialNumber(),
-        CertificateCodec.getX509Certificate(xcert));
+    if (scmCert) {
+      // If scm cert store in scm cert table and valid cert table.
+      // This is to help to return scm certs when get certs call.
+      store.storeValidScmCertificate(xcert.getSerialNumber(),
+          CertificateCodec.getX509Certificate(xcert));

Review comment:
       SCM Certs are stored in scmCertTable because we want to queryCerts for 
scm Role.  This will come in help during SCM Startup, where each SCM need to 
get all SCM certs of its quorum.
   And also added to fall back table validCertTables because to not to break 
list API, where it is listing all certs.




----------------------------------------------------------------
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.

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