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

Check cluster access #681

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
14 changes: 9 additions & 5 deletions run_kraken.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,11 @@ def main(cfg):
except:
kubecli.initialize_clients(None)

cluster_access = kubecli.check_rbac_access('pods','get')

# find node kraken might be running on
kubecli.find_kraken_node()
if cluster_access:
kubecli.find_kraken_node()

# Set up kraken url to track signal
if not 0 <= int(port) <= 65535:
Expand Down Expand Up @@ -388,10 +391,11 @@ def main(cfg):
# if platform is openshift will be collected
# Cloud platform and network plugins metadata
# through OCP specific APIs
if distribution == "openshift":
telemetry_ocp.collect_cluster_metadata(chaos_telemetry)
else:
telemetry_k8s.collect_cluster_metadata(chaos_telemetry)
if cluster_access:
if distribution == "openshift":
telemetry_ocp.collect_cluster_metadata(chaos_telemetry)
else:
telemetry_k8s.collect_cluster_metadata(chaos_telemetry)

decoded_chaos_run_telemetry = ChaosRunTelemetry(json.loads(chaos_telemetry.to_json()))
chaos_output.telemetry = decoded_chaos_run_telemetry
Expand Down
Loading