feat: sanitize docker inspect output with ps:inspect

Often-times, we will want to have the container inspect output for debugging purposes, but this process is:

- error prone, as the user needs to know what their containers are
- potentially insecure, as the output must be sanitized of sensitive data

Instead of making users wade through this process, we provide a helper `ps:inspect` command, that can be used to diagnose problems associated with containers that may or may not exist for an application.
This commit is contained in:
Jose Diaz-Gonzalez
2018-10-14 19:39:24 -04:00
parent 44d8eb4cb7
commit 15a2b7cbce
8 changed files with 116 additions and 2 deletions

View File

@@ -12,6 +12,17 @@ teardown() {
global_teardown
}
@test "(ps) ps:inspect" {
deploy_app dockerfile
CID=$(< $DOKKU_ROOT/$TEST_APP/CONTAINER.web.1)
run bash -c "dokku ps:inspect $TEST_APP"
echo "output: "$output
echo "status: "$status
assert_success
assert_output_contains "$CID" 6
}
@test "(ps:scale) procfile commands extraction" {
source "$PLUGIN_CORE_AVAILABLE_PATH/ps/functions"
cat <<EOF > "$DOKKU_ROOT/$TEST_APP/DOKKU_PROCFILE"