Skip to content

Commit

Permalink
Remove deprecated call to oc sa get-token (#2592)
Browse files Browse the repository at this point in the history
The new command "oc create token" is available since OCP 4.11.

Co-authored-by: Martin Gencur <[email protected]>
  • Loading branch information
openshift-cherrypick-robot and mgencur authored Apr 2, 2024
1 parent df94ea5 commit 318ceeb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/lib.bash
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ function check_serverless_alerts {
alerts_file="${ARTIFACTS:-/tmp}/alerts.json"
monitoring_route=$(oc -n openshift-monitoring get routes alertmanager-main -oyaml -ojsonpath='{.spec.host}')
# TODO(SRVKE-669) remove the filter for the pingsource-mt-adapter service once issue is fixed.
curl -k -H "Authorization: Bearer $(oc -n openshift-monitoring sa get-token prometheus-k8s || oc -n openshift-monitoring create token prometheus-k8s)" \
curl -k -H "Authorization: Bearer $(oc -n openshift-monitoring create token prometheus-k8s)" \
"https://${monitoring_route}/api/v1/alerts" | \
jq -c '.data | map(select((.labels.service != "pingsource-mt-adapter") and (.labels.namespace == "'"${OPERATORS_NAMESPACE}"'" or .labels.namespace == "'"${EVENTING_NAMESPACE}"'" or .labels.namespace == "'"${SERVING_NAMESPACE}"'" or .labels.namespace == "'"${INGRESS_NAMESPACE}"'")))' > "${alerts_file}"

Expand Down

0 comments on commit 318ceeb

Please sign in to comment.