Fix bug 2071: create secret 96/12496/1 v10.1.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:47 +0000 (13:17 +0200)
commit8f8088c0023194249c780b5d2ef5698dee98eadb
treea9d16b46a5e185a0494fcd06ff17ebcfc1f591b7
parent5749c53dc559869521242e225b83d02d9ec115a8
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