Fix bug 2071: create secret 95/12495/1 v12.0.2 v12.0.3
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 11:17:06 +0000 (13:17 +0200)
commit6a963f583ea98494d767a1b860a545168c57bf83
treee774f20dc07c0f3b6182649f8b1ecef5f502e06e
parent537d2939398ceeb510599cbf4393383044a99494
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>
(cherry picked from commit 6343d434fa3cec28d8b9b470054d3a13ada8865a)
n2vc/kubectl.py
n2vc/tests/unit/test_kubectl.py