Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ in development
Added
~~~~~

* Error on `st2ctl status` when running in Kubernetes. #5851
Contributed by @mamercad

* Continue introducing `pants <https://www.pantsbuild.org/docs>`_ to improve DX (Developer Experience)
working on StackStorm, improve our security posture, and improve CI reliability thanks in part
to pants' use of PEX lockfiles. This is not a user-facing addition.
Expand Down
8 changes: 8 additions & 0 deletions st2common/bin/st2ctl
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ function must_be_root() {
fi
}

function not_running_in_k8s() {
if [ -n "$KUBERNETES_SERVICE_HOST" ]; then
echo -e "\e[31mError: \"st2ctl status\" is not supported under Kubernetes \e[0m\n"
exit 1
fi
}

function validate_in_components() {
COM=${1}

Expand Down Expand Up @@ -263,6 +270,7 @@ case ${1} in
fi
;;
status)
not_running_in_k8s
getpids
;;
*)
Expand Down