Enhance st2ctl Docker detection and usage hints (#4988)#6334
Open
Emu55 wants to merge 4 commits intoStackStorm:masterfrom
Open
Enhance st2ctl Docker detection and usage hints (#4988)#6334Emu55 wants to merge 4 commits intoStackStorm:masterfrom
Emu55 wants to merge 4 commits intoStackStorm:masterfrom
Conversation
|
|
guzzijones
approved these changes
Jul 15, 2025
Contributor
guzzijones
left a comment
There was a problem hiding this comment.
seems like a logical check with good user feedback.
Author
|
Hi @guzzijones , |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enhance
st2ctlDocker detection and usage hintsThis pull request adds support for detecting when
st2ctlis being run inside a Docker container and, for VM-style commands, immediately exits with a clear error message and guidance on the proper Docker commands to use.Background
The
st2ctlscript was originally written to manage StackStorm services on a single host or VM, using tools likeps,systemctl, or direct process checks. In containerized deployments, each StackStorm component runs in its own Docker container, so those VM-style operations:Issue #4988 requests that
st2ctldetect this scenario and provide helpful Docker-specific guidance instead of attempting unsupported operations.What’s Changed
Docker detection helper
Added a new function
running_in_docker()which returns success if either:/.dockerenvis present, or/proc/1/cgroupUsage suggestion helper
Added
suggest_docker_usage(subcommand)which:1Early exit for VM-style commands
Inserted a pre-dispatch check before the main
case "$1" in … esacblock: