Skip to content

Commit

Permalink
Merge pull request #119 from ibm-apiconnect/wmce-8629
Browse files Browse the repository at this point in the history
add early exit if oc user not logged in
  • Loading branch information
WilliamMcEnery authored Feb 20, 2024
2 parents 6c31f43 + 7230f87 commit d45afba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions generate_postmortem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ warn_if_script_is_not_latest() {
which oc &> /dev/null
if [[ $? -eq 0 ]]; then
KUBECTL="oc"
$KUBECTL whoami
if [[ $? -ne 0 ]]; then
echo "Error: oc whoami failed. This script requires you to be logged in to the server. EXITING..."
exit 1
fi
else
which kubectl &> /dev/null
if [[ $? -ne 0 ]]; then
Expand Down

0 comments on commit d45afba

Please sign in to comment.