Fix certificate-key to 64 characters

Update get_secure_static_config() to fix the
kubernetes::kubeadm::certificate-key,  to the 64 characters
expected by kubernetes.

Change-Id: I366e6eb1dc4e764425ef2a82a493db47a080f49a
Closes-bug: 1876755
Signed-off-by: John Kung <john.kung@windriver.com>
This commit is contained in:
John Kung 2020-05-04 17:13:59 -04:00
parent 6cc18c3a28
commit 40463adf9a
1 changed files with 1 additions and 1 deletions

View File

@ -102,7 +102,7 @@ class KubernetesPuppet(base.BasePuppet):
key = keyring.get_password(CERTIFICATE_KEY_SERVICE,
CERTIFICATE_KEY_USER)
if not key:
key = '{:64x}'.format(random.getrandbits(8 * 32))
key = '{:064x}'.format(random.getrandbits(8 * 32))
keyring.set_password(CERTIFICATE_KEY_SERVICE,
CERTIFICATE_KEY_USER, key)
LOG.info('storing kubernetes_kubeadm_certificate_key')