@@ -32,7 +32,11 @@ default_version() {
32
32
33
33
clean_status_output () {
34
34
local output_file=" $1 "
35
- cat " ${output_file} " | grep " │" | tr -d ' '
35
+ # This removes the 'IMAGE BUILD DATE" and 'VCS REF' columns and
36
+ # removes the whitespace between columns.
37
+ grep " │" " ${output_file} " \
38
+ | cut -d ' │' -f 1-4,7- \
39
+ | tr -d ' '
36
40
}
37
41
38
42
trap cleanup EXIT
@@ -90,20 +94,20 @@ curl --cacert "${ELASTIC_PACKAGE_CA_CERT}" -f "${ELASTIC_PACKAGE_KIBANA_HOST}/lo
90
94
# Check status with running services
91
95
cat << EOF > "${OUTPUT_PATH_STATUS} /expected_running.txt"
92
96
Status of Elastic stack services:
93
- ╭──────────────────┬─────────┬───────────────────╮
94
- │ SERVICE │ VERSION │ STATUS │
95
- ├──────────────────┼─────────┼───────────────────┤
96
- │ elastic-agent │ ${EXPECTED_VERSION} │ running (healthy) │
97
- │ elasticsearch │ ${EXPECTED_VERSION} │ running (healthy) │
98
- │ fleet-server │ ${EXPECTED_VERSION} │ running (healthy) │
99
- │ kibana │ ${EXPECTED_VERSION} │ running (healthy) │
100
- │ package-registry │ latest │ running (healthy) │
101
- ╰──────────────────┴─────────┴───────────────────╯
97
+ ╭──────────────────┬───────────────────── ┬───────────────────┬───────────────────┬ ────────────╮
98
+ │ SERVICE │ VERSION │ STATUS │ IMAGE BUILD DATE │ VCS REF │
99
+ ├──────────────────┼───────────────────── ┼───────────────────┼───────────────────┼ ────────────┤
100
+ │ elastic-agent │ ${EXPECTED_VERSION} │ running (healthy) │ 2024-08-22T02:44Z │ b96a4ca8fa │
101
+ │ elasticsearch │ ${EXPECTED_VERSION} │ running (healthy) │ 2024-08-22T13:26Z │ 1362d56865 │
102
+ │ fleet-server │ ${EXPECTED_VERSION} │ running (healthy) │ 2024-08-22T02:44Z │ b96a4ca8fa │
103
+ │ kibana │ ${EXPECTED_VERSION} │ running (healthy) │ 2024-08-22T11:09Z │ cdcdfddd3f │
104
+ │ package-registry │ latest │ running (healthy) │ │ │
105
+ ╰──────────────────┴───────────────────── ┴───────────────────┴───────────────────┴ ────────────╯
102
106
EOF
103
107
104
108
elastic-package stack status -v 2> " ${OUTPUT_PATH_STATUS} /running.txt"
105
109
106
- # Remove spaces to avoid issues with spaces between columns
110
+ # Remove dates, commit IDs, and spaces to avoid issues.
107
111
clean_status_output " ${OUTPUT_PATH_STATUS} /expected_running.txt" > " ${OUTPUT_PATH_STATUS} /expected_no_spaces.txt"
108
112
clean_status_output " ${OUTPUT_PATH_STATUS} /running.txt" > " ${OUTPUT_PATH_STATUS} /running_no_spaces.txt"
109
113
0 commit comments