-
Notifications
You must be signed in to change notification settings - Fork 11
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
ignore errors to communicate with live cluster if it is not an explicit requirement #354
Conversation
…vided explicitly by user 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) |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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
#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