Fix bug 2071: create secret 77/12477/7
authorPatricia Reinoso <patricia.reinoso@canonical.com>
Tue, 23 Aug 2022 06:22:01 +0000 (06:22 +0000)
committercalvinosanc1 <guillermo.calvino@canonical.com>
Mon, 29 Aug 2022 09:22:04 +0000 (11:22 +0200)
commit6343d434fa3cec28d8b9b470054d3a13ada8865a
tree459f69824adfc238dfd87f2ec6611316b7bf90c6
parent015abee87f591b8e28f6b982ae4fb9c67e8791bb
Fix bug 2071: create secret

Manually create a service-account-token secret
for service account when k8s cluster is created
in case k8s version >=1.24.

ServiceAccount object should be created first.
When deleting a k8s cluster. Corresponding
ServiceAccount and Secret are automatically
deleted as well.

In k8s < 1.24, secret is automatically created.

Change-Id: I160b1f87a64cf7a1bbb1fa8587259d8fbd3e6cd4
Signed-off-by: Patricia Reinoso <patricia.reinoso@canonical.com>
n2vc/kubectl.py
n2vc/tests/unit/test_kubectl.py