Optimize CA cert hash calculation with community.crypto (#11758)

Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
This commit is contained in:
ERIK
2024-12-02 18:27:00 +08:00
committed by GitHub
parent 8b96d00d30
commit 98807ffb6b
6 changed files with 14 additions and 16 deletions

View File

@@ -13,9 +13,9 @@ discovery:
apiServerEndpoint: {{ kubeadm_discovery_address }}
{% endif %}
token: {{ kubeadm_token }}
{% if kubeadm_ca_hash.stdout is defined %}
{% if ca_cert_content is defined %}
caCertHashes:
- sha256:{{ kubeadm_ca_hash.stdout }}
- sha256:{{ (ca_cert_content.content | b64decode | community.crypto.x509_certificate_info).public_key_fingerprints.sha256.replace(':', '') }}
{% else %}
unsafeSkipCAVerification: true
{% endif %}