diff --git a/show/kube.py b/show/kube.py index 5ab8cf3f6f..a120c46296 100644 --- a/show/kube.py +++ b/show/kube.py @@ -45,7 +45,7 @@ def config(db): # (
, , ) ("ip", "ip" "", False), ("port", "port", "6443"), - ("insecure", "insecure", "False"), + ("insecure", "insecure", "True"), ("disable","disable", "False") ] diff --git a/tests/kube_test.py b/tests/kube_test.py index 90a4f6e292..e49a2a55f8 100644 --- a/tests/kube_test.py +++ b/tests/kube_test.py @@ -34,6 +34,18 @@ 10.3.157.24 7777 True False """ +show_server_output_5="""\ +ip port insecure disable +----------- ------ ---------- --------- +10.10.10.11 6443 True False +""" + +show_server_output_6="""\ +ip port insecure disable +----------- ------ ---------- --------- +10.3.157.24 6443 True False +""" + empty_server_status="""\ Kubernetes server has no status info """ @@ -96,6 +108,20 @@ def test_no_kube_server(self, get_cmd_module): result = runner.invoke(config.config.commands["kubernetes"].commands["server"], ["ip", "10.10.10.11"], obj=db) self.__check_res(result, "set server IP when none", "") + result = runner.invoke(show.cli.commands["kubernetes"].commands["server"].commands["config"], [], obj=db) + self.__check_res(result, "config command default value", show_server_output_5) + + + def test_only_kube_server(self, get_cmd_module): + (config, show) = get_cmd_module + runner = CliRunner() + db = Db() + + db.cfgdb.delete_table("KUBERNETES_MASTER") + db.cfgdb.set_entry("KUBERNETES_MASTER", "SERVER", {"ip": "10.3.157.24"}) + + result = runner.invoke(show.cli.commands["kubernetes"].commands["server"].commands["config"], [], obj=db) + self.__check_res(result, "show command default value", show_server_output_6) def test_kube_server_status(self, get_cmd_module):