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