Skip to content

Commit

Permalink
Merge pull request #94 from openshift-cherrypick-robot/cherry-pick-93…
Browse files Browse the repository at this point in the history
…-to-release-4.14

[release-4.14] OCPBUGS-22172: Move commands to the function to avoid them being executed on -h.
  • Loading branch information
openshift-ci[bot] committed Oct 23, 2023
2 parents 5ef9f0e + 81809e3 commit a1dc6af
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions debug-scripts/local-scripts/ovn-pprof-forwarding
Expand Up @@ -24,24 +24,25 @@ Examples:
"
}

if ! command -v nc &> /dev/null; then
echo "nc is not installed. Exiting." >&2
exit 1
fi

CM_OR_MASTER_PORT=8100
NODE_PORT=8200

if [ $(get_ovn_mode) == "ovn-ic" ]; then
PPROF_CM_OR_MASTER_PORT=29108
else
PPROF_CM_OR_MASTER_PORT=29102
fi

prepare () {
set -u pipefail

trap ctrl_c EXIT

if ! command -v nc &> /dev/null; then
echo "nc is not installed. Exiting." >&2
exit 1
fi

if [ $(get_ovn_mode) == "ovn-ic" ]; then
PPROF_CM_OR_MASTER_PORT=29108
else
PPROF_CM_OR_MASTER_PORT=29102
fi

IFS=" " read -r -a OVNKUBE_MASTER_PODS <<< "$(oc -n openshift-ovn-kubernetes get pods -l 'app in (ovnkube-master,ovnkube-control-plane)' -o=jsonpath='{.items[*].metadata.name}')"
for OVNKUBE_MASTER_POD in "${OVNKUBE_MASTER_PODS[@]}"; do
oc port-forward "${OVNKUBE_MASTER_POD}" ${CM_OR_MASTER_PORT}:${PPROF_CM_OR_MASTER_PORT} -n openshift-ovn-kubernetes > /dev/null &
Expand Down

0 comments on commit a1dc6af

Please sign in to comment.