Migrate datanode CA to cluster config service, refactor handling (#19747)

* Added test for LegacyDatanodeKeystoreProvider, removed CertService dependency

* Added license

* fixed nonnull annotation

* Migrate datanode CA to cluster config service, refactor handling

* code cleanup

* Added changelog

* fixed exception

* Added unit tests for CaPersistenceService

* Migrate certificate authority before preflight

---------

Co-authored-by: Matthias Oesterheld <33032967+moesterheld@users.noreply.github.com>
This commit is contained in:
Tomas Dvorak
2024-07-03 14:53:52 +02:00
committed by GitHub
parent 8cfc618580
commit a26a09488a
27 changed files with 717 additions and 660 deletions

View File

@@ -58,6 +58,7 @@ public class LegacyDatanodeKeystoreProvider {
private static final Logger LOG = LoggerFactory.getLogger(LegacyDatanodeKeystoreProvider.class);
public static final String LEGACY_COLLECTION_NAME = "data_node_certificates";
public static final String ENCRYPTED_CERTIFICATE_FIELD = "encrypted_certificate_keystore";
private final NodeId nodeId;
private final String passwordSecret;
@@ -123,7 +124,7 @@ public class LegacyDatanodeKeystoreProvider {
final Document nodeCertificate = objects.first();
if (nodeCertificate != null) {
final Document encryptedCertificateDocument = nodeCertificate.get("encrypted_certificate_keystore", Document.class);
final Document encryptedCertificateDocument = nodeCertificate.get(ENCRYPTED_CERTIFICATE_FIELD, Document.class);
if (encryptedCertificateDocument != null) {
final EncryptedValue encryptedCertificate = EncryptedValue.builder()
.value(encryptedCertificateDocument.getString(ENCRYPTED_VALUE_SUBFIELD))