Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on st2ctl status when running in k8s #5851

Merged
merged 3 commits into from
Dec 19, 2022
Merged
Show file tree
Hide file tree
Changes from all 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, please use Kubernetes tools such as \"kubectl\" to view the StackStorm services in this cluster. \e[0m\n"
mamercad marked this conversation as resolved.
Show resolved Hide resolved
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