-
Notifications
You must be signed in to change notification settings - Fork 130
stack status cmd - add columns for image build date and VCS reference #2057
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
Merged
andrewkroh
merged 4 commits into
elastic:main
from
andrewkroh:feature/stack-status-vcs-ref
Nov 14, 2025
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d8f0c97
stack status cmd - add columns for image build date and VCS reference
andrewkroh ff8b012
make test-stack-command pass
andrewkroh 00f379f
Merge remote-tracking branch 'elastic/main' into feature/stack-status…
andrewkroh d3eaa74
Fix nil pointer dereference for serverless environments
andrewkroh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,12 @@ default_version() { | |
|
|
||
| clean_status_output() { | ||
| local output_file="$1" | ||
| cat "${output_file}" | grep "│" | tr -d ' ' | ||
| # This removes the 'IMAGE BUILD DATE" and 'VCS REF' columns and | ||
| # removes the whitespace between columns. | ||
| grep "│" "${output_file}" \ | ||
| | sed 's/│/|/g' \ | ||
| | cut -d '|' -f 1-4,7- \ | ||
| | tr -d ' ' | ||
|
Comment on lines
+52
to
+57
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks good 👍 Before: Now: |
||
| } | ||
|
|
||
| trap cleanup EXIT | ||
|
|
@@ -90,20 +95,20 @@ curl --cacert "${ELASTIC_PACKAGE_CA_CERT}" -f "${ELASTIC_PACKAGE_KIBANA_HOST}/lo | |
| # Check status with running services | ||
| cat <<EOF > "${OUTPUT_PATH_STATUS}/expected_running.txt" | ||
| Status of Elastic stack services: | ||
| ╭──────────────────┬─────────┬───────────────────╮ | ||
| │ SERVICE │ VERSION │ STATUS │ | ||
| ├──────────────────┼─────────┼───────────────────┤ | ||
| │ elastic-agent │ ${EXPECTED_VERSION} │ running (healthy) │ | ||
| │ elasticsearch │ ${EXPECTED_VERSION} │ running (healthy) │ | ||
| │ fleet-server │ ${EXPECTED_VERSION} │ running (healthy) │ | ||
| │ kibana │ ${EXPECTED_VERSION} │ running (healthy) │ | ||
| │ package-registry │ latest │ running (healthy) │ | ||
| ╰──────────────────┴─────────┴───────────────────╯ | ||
| ╭──────────────────┬─────────────────────┬───────────────────┬───────────────────┬────────────╮ | ||
| │ SERVICE │ VERSION │ STATUS │ IMAGE BUILD DATE │ VCS REF │ | ||
| ├──────────────────┼─────────────────────┼───────────────────┼───────────────────┼────────────┤ | ||
| │ elastic-agent │ ${EXPECTED_VERSION} │ running (healthy) │ 2024-08-22T02:44Z │ b96a4ca8fa │ | ||
| │ elasticsearch │ ${EXPECTED_VERSION} │ running (healthy) │ 2024-08-22T13:26Z │ 1362d56865 │ | ||
| │ fleet-server │ ${EXPECTED_VERSION} │ running (healthy) │ 2024-08-22T02:44Z │ b96a4ca8fa │ | ||
| │ kibana │ ${EXPECTED_VERSION} │ running (healthy) │ 2024-08-22T11:09Z │ cdcdfddd3f │ | ||
| │ package-registry │ latest │ running (healthy) │ │ │ | ||
| ╰──────────────────┴─────────────────────┴───────────────────┴───────────────────┴────────────╯ | ||
| EOF | ||
|
|
||
| elastic-package stack status -v 2> "${OUTPUT_PATH_STATUS}/running.txt" | ||
|
|
||
| # Remove spaces to avoid issues with spaces between columns | ||
| # Remove dates, commit IDs, and spaces to avoid issues. | ||
| clean_status_output "${OUTPUT_PATH_STATUS}/expected_running.txt" > "${OUTPUT_PATH_STATUS}/expected_no_spaces.txt" | ||
| clean_status_output "${OUTPUT_PATH_STATUS}/running.txt" > "${OUTPUT_PATH_STATUS}/running_no_spaces.txt" | ||
|
|
||
|
|
||
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When creating a serverless project, there are no local containers at least for elasticsearch, kibana and fleet. For that scenario,
service.Labelsfield is nil.Here there is an example of the panic error that it is raised because of that:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be an example of that command with one of the latest elastic-package versions:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in d3eaa74.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Just checked using other providers like Serverless and Environment, and it worked successfully