Use default Previous Work Dir if there is none When the folder where the working dir was is deleted an Exception is thrown. In that case a new default directory is defined. Change-Id: Ic0b3eb63625fc6cf6e90e9a77891c9958b6a9aee Signed-off-by: Dominik Fleischmann <dominik.fleischmann@canonical.com>
Ommit public_key argument if None With newer Juju versions the authorized-keys argument is expected to not be None, therefore it now has to be ommited as an argument if thats the case. Change-Id: I0adeda2ce71df5505cfaaab98ec237611918d9e7 Signed-off-by: Dominik Fleischmann <dominik.fleischmann@canonical.com>
Fix missing import Import was removed for flake8 compliance, but it was needed at runtime. Change-Id: I2c1fce7b681582382c3c8f74267c3010bfcd97d6 Signed-off-by: beierlm <mark.beierl@canonical.com>
Enable lint, flake8 and unit tests Cleans up non pep compliant code. Adds a simple unit test. Formats according to black. Tox automatically runs lint, flake8 and unit test suite with coverage. To run each individually, execute: tox -e pylint tox -e black tox -e flake8 tox -e cover Note that these are all run for each patch via Jenkins. The full tox suite should be run locally before any commit to ensure it will not fail in Jenkins. Change-Id: I2f87abe3d5086d6d65ac33a27780c498fc7b1cd3 Signed-off-by: beierlm <mark.beierl@canonical.com>
K8s action support This commit enables k8s actions by executing them the same way as any other ns-action. It needs a mandatory parameter which is application-name. This commit depends on another commit in LCM. https://osm.etsi.org/gerrit/#/c/osm/LCM/+/8767/ Change-Id: I375fb93d55f1255d425f229fe1a88968b19ae3d0 Signed-off-by: Dominik Fleischmann <dominik.fleischmann@canonical.com>
adding optional namespace to K8s install Change-Id: Ib433aff72f68f56359917a8a3716e6b798ea330b Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
Add local k8s charms support This adds the support to deploy Kuberentes Charm Bundles that are available locally (directly inside the vnf descriptor). Change-Id: Ib2e191df5f905ba909f935f2005347d2cf83da74 Signed-off-by: Dominik Fleischmann <dominik.fleischmann@canonical.com>
Fix logging in Juju K8s code This fixes the logging in the juju k8s code base which wasn't showing up in the LCM logs. This logging follows the same standard as the rest of LCM code base. Change-Id: I569d2bc1e3c50e73ac9af129f1d59775b89cb3ca Signed-off-by: Dominik Fleischmann <dominik.fleischmann@canonical.com> (cherry picked from commit 2f2832cc214c058d3fce343cdd459ccddd770dad)
1000: Fix authentication when deleting service This fixes 1000 where the creation of k8sclusters was failing once a k8scluster had been deleted. This was due to N2VC not logging out correctly from the juju controller. Error handling was added to the add_model funciton. https://osm.etsi.org/bugzilla/show_bug.cgi?id=1000 Change-Id: I144ddf7ed16a3aa65e145459e49f41b9fd936353 Signed-off-by: Dominik Fleischmann <dominik.fleischmann@canonical.com> (cherry picked from commit 1ac78b3b0c1440f4c69834387c7ceafdff27ac28)
Synchronize helm repos on ns instantiation instead of creation Change-Id: Ia4f35283399d2777ff3df1fb2824a68cbaec4804 Signed-off-by: lloretgalleg <illoret@indra.es> (cherry picked from commit 65ddf85ef9d11aa4d4f9dc7cb2912ff7069f7c94)
1007 Use KDU name and NS id for model names This commit is part of the fix for Bug 1007. Previously The wrong naming was used in the uninstall function and it was deleting each application one by one. Now the whole model will be deleted automatically. This commit is dependent on this one in LCM: https://osm.etsi.org/gerrit/#/c/osm/LCM/+/8555/ Additionally the naming for models has changes so that each KDU gets is own model with the following naming: <kdu-name>-<ns-id> . This will fix multi KDU support. Change-Id: I912105417d67d5f3d95b997b91d7a5b7388bdf0d Signed-off-by: Dominik Fleischmann <dominik.fleischmann@canonical.com> (cherry picked from commit 847f3c055188614da2cd7ea8028db8ab025eb1d8)
k8s_juju_conn.py: fix cloud name for k8s Change-Id: I182d62fa5997c4a3a6137668827b2e100901ee47 Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
Fix bug 1002 This patch fixes bug 1002 by using the async-friendly `asyncio.create_subprocess_exec` instead of `subprocess.run`. Change-Id: Ie290e3f879ee83345c0b783116ef2f1e8982e537 Signed-off-by: Adam Israel <adam.israel@canonical.com> (cherry picked from commit 3419aba44ae1829dab01b9eceb39a0425e8af973)
Add check for local k8s Change-Id: Ib408bb3d2412c064cb8ad14c3ff16fd537d84a49 Signed-off-by: David Garcia <david.garcia@canonical.com> (cherry picked from commit ace992dd8c55fb909832bc26e05a9eb7e2e21055)
Use NS uuid when creating a juju k8s model This commit fixes bug 972, previously it was using the namespace value that was always assigned to kube-system. This caused an error in Juju due to kube-system already existing. https://osm.etsi.org/bugzilla/show_bug.cgi?id=972 Change-Id: I840d65ef9991f64eba42a205900d42cb0a9bbeef Signed-off-by: Dominik Fleischmann <dominik.fleischmann@canonical.com> (cherry picked from commit ad3a05447418afef1d7b1998f9d7e351ccf9fe40)
Juju/k8s fixes Fix how non-microk8s clusters are bootstrapped Change-Id: Idf771fdd4d14f2876e0107f1d636eabc5169e170 Signed-off-by: Adam Israel <adam.israel@canonical.com>
Sync with k8s api Updates to sync with changes to the underlying k8s API Change-Id: I8c4022c9783a1c87c7c61a36074a614d211d0c81 Signed-off-by: Adam Israel <adam.israel@canonical.com>
K8s Juju connector Juju connector for Kubernetes Change-Id: I2a020aa55840dd7e76391d7ad751be7c56db5eeb Signed-off-by: Adam Israel <adam.israel@canonical.com>