Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change show kube command default value of insecure key to True #2517

Merged
merged 2 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion show/kube.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def config(db):
# (<header name>, <field name>, <default val>)
("ip", "ip" "", False),
("port", "port", "6443"),
("insecure", "insecure", "False"),
("insecure", "insecure", "True"),
("disable","disable", "False")
]

Expand Down
26 changes: 26 additions & 0 deletions tests/kube_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""
Expand Down Expand Up @@ -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):
Expand Down