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

ignore errors to communicate with live cluster if it is not an explicit requirement #354

Merged

Conversation

shireenf-ibm
Copy link
Member

#351
any implicit attempt to load from k8s live cluster will occur silently
explicit attempts (e.g. k8s is an input resource) - runs as usual (communication errors are not ignored)
Signed-off-by: shireenf-ibm shireenf@il.ibm.com

…vided explicitly by user

Signed-off-by: shireenf-ibm <shireenf@il.ibm.com>
@shireenf-ibm shireenf-ibm linked an issue Nov 10, 2022 that may be closed by this pull request
nca/Utils/CmdlineRunner.py Outdated Show resolved Hide resolved
Signed-off-by: shireenf-ibm <shireenf@il.ibm.com>
nca/Utils/CmdlineRunner.py Outdated Show resolved Hide resolved
Signed-off-by: shireenf-ibm <shireenf@il.ibm.com>
Signed-off-by: shireenf-ibm <shireenf@il.ibm.com>
@@ -95,7 +98,7 @@ def get_k8s_resources(resource):
cmdline_list = ['kubectl', 'get', resource, '-o=json']
if resource in ['networkPolicy', 'authorizationPolicy', 'pod', 'ingress', 'Gateway', 'VirtualService', 'sidecar']:
cmdline_list.append('--all-namespaces')
return CmdlineRunner.run_and_get_output(cmdline_list)
return CmdlineRunner.run_and_get_output(cmdline_list, check_for_silent_exec=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't also be set True from get_calico_resources, not only from get_k8s_resources ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently if the topology section is missing / or user runs cmdline without resources or without policies - our default is to load missing resources from k8s live cluster - so it is the only relevant case for a silent attempt

we load from calico only if the input is calico - a provided "live cluster" input does not ignore errors for any of the layers

@shireenf-ibm shireenf-ibm merged commit f9ccfc9 into master Nov 10, 2022
@shireenf-ibm shireenf-ibm deleted the issue_351_support_scheme_w_missing_global_section branch November 10, 2022 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

support scheme file with missing global section
2 participants