From 318ceebe688c31a55e884df114af6aed67a6210e Mon Sep 17 00:00:00 2001 From: OpenShift Cherrypick Robot Date: Tue, 2 Apr 2024 16:20:51 +0200 Subject: [PATCH] Remove deprecated call to oc sa get-token (#2592) The new command "oc create token" is available since OCP 4.11. Co-authored-by: Martin Gencur --- test/lib.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lib.bash b/test/lib.bash index 4a841e7c65..c7e423593d 100644 --- a/test/lib.bash +++ b/test/lib.bash @@ -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}"