mirror of
https://github.com/krkn-chaos/krkn.git
synced 2026-08-25 09:27:36 +00:00
Add prom token creation step
This enables compatability with all OpenShift versions. Reference PR by Paige in Cerberus: https://github.com/redhat-chaos/cerberus/pull/190.
This commit is contained in:
@@ -11,6 +11,7 @@ def instance(distribution, prometheus_url, prometheus_bearer_token):
|
||||
if distribution == "openshift" and not prometheus_bearer_token:
|
||||
prometheus_bearer_token = runcommand.invoke(
|
||||
"oc -n openshift-monitoring sa get-token prometheus-k8s "
|
||||
"|| oc create token -n openshift-monitoring prometheus-k8s"
|
||||
"|| oc create token -n openshift-monitoring prometheus-k8s --duration=12h "
|
||||
"|| oc sa new-token -n openshift-monitoring prometheus-k8s"
|
||||
)
|
||||
return prometheus_url, prometheus_bearer_token
|
||||
|
||||
Reference in New Issue
Block a user