This commit is contained in:
Jonathan Ervine 2020-12-28 15:48:07 +08:00
parent e021f099a8
commit ce93547df7

27
main.py
View File

@ -23,33 +23,6 @@ def get_namespaces():
ns = v1.list_namespace() ns = v1.list_namespace()
return ns return ns
<<<<<<< HEAD
def get_tiller_namespaces():
command = "/usr/local/bin/kubectl get deploy --all-namespaces -l name=tiller -ojson"
info(f"Running command: {command}")
try:
output = check_output(command.split(" "), stderr=STDOUT).decode("utf-8")
except CalledProcessError as err:
error(err.output.decode("utf-8"))
raise err
info(f"Output from command:\n{output}")
data = json.loads(output)
return data
def get_deployments(namespace):
command = "/usr/local/bin/kubectl -n " + namespace + " get deploy -ojson"
info(f"Running command: {command}")
try:
output = check_output(command.split(" "), stderr=STDOUT).decode("utf-8")
except CalledProcessError as err:
error(err.output.decode("utf-8"))
raise err
info(f"Output from command:\n{output}")
data = json.loads(output)
return data
=======
>>>>>>> a7df40eb7710553f5d0185c3fa04ea6991c06f89
def get_charts(ns): def get_charts(ns):
command = "/usr/local/bin/helm -n " + ns + " list -ojson" #helm3 command = "/usr/local/bin/helm -n " + ns + " list -ojson" #helm3
info(f"Running command: {command}") info(f"Running command: {command}")