From 2f9a3e272c0f7b7b70b2dd3dbceb75d30741874c Mon Sep 17 00:00:00 2001 From: Jenia Peimer Date: Thu, 10 Oct 2024 14:17:54 +0300 Subject: [PATCH] Fix review comments --- README.md | 8 +++++--- app/main.py | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ab6c0fb..1d3b211 100644 --- a/README.md +++ b/README.md @@ -40,10 +40,12 @@ get Node # To get all Nodes get PersistentVolumeClaim hpp # To get all PVCs when name starts from 'hpp' get pvc -n openshift-storage hpp # To get all PVCs in 'openshift-storage' namespace when name starts from 'hpp' ``` -- To print the resource YAML, add `yaml` to the `get` command, for example: + +- To print the resource YAML, add `-oyaml` to the `get` command, for example: + ```bash -get pvc hpp yaml # To print yamls of all PVCs when name starts from 'hpp' -get pvc -n openshift-storage hpp yaml # To print yamls of all PVCs in 'openshift-storage' namespace when name starts from 'hpp' +get pvc hpp -oyaml # To print yamls of all PVCs when name starts from 'hpp' +get pvc -n openshift-storage hpp -oyaml # To print yamls of all PVCs in 'openshift-storage' namespace when name starts from 'hpp' ``` - Help: diff --git a/app/main.py b/app/main.py index a2e5a86..a37ae48 100644 --- a/app/main.py +++ b/app/main.py @@ -79,7 +79,6 @@ def main( actions_dict: Dict[str, Any] = { GET_ACTION: get_resources, - "yaml": print_resource_yaml, "logs": get_logs, "describe": get_describe, "exit": None, @@ -156,7 +155,8 @@ def main( if not resources_raw_data: CONSOLE.print(f"No resources found for {resource_kind} {resource_name} {namespace_name}") continue - actions_dict[action_name](resources_raw_data) + + actions_dict[action_name](resources_raw_data, print_yaml) def get_resources(resources_raw_data: List[Dict[str, Any]], print_yaml: bool = False, **kwargs: Dict[Any, Any]) -> None: