Skip to content

Commit a0bc2ee

Browse files
author
Marcelo Carneiro do Amaral
authored
Merge pull request #41 from sthaha/fix-print-config
fix: report prometheus install status correctly
2 parents 1ea3df3 + d7fbf62 commit a0bc2ee

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

main.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ cluster_up() {
5959
run cp "$kubeconfig" "$CLUSTER_KUBECONFIG"
6060
export KUBECONFIG="$CLUSTER_KUBECONFIG"
6161

62-
if is_set "${PROMETHEUS_ENABLE}" || is_set "GRAFANA_ENABLE"; then
62+
if is_set "$PROMETHEUS_ENABLE" || is_set "$GRAFANA_ENABLE"; then
6363
source "$PROJECT_ROOT/lib/prometheus.sh"
6464
deploy_prometheus_operator
6565
fi
@@ -73,6 +73,11 @@ print_config() {
7373
local cluster_config
7474
cluster_config=$("${CLUSTER_PROVIDER}"_print_config)
7575

76+
local prom_install_msg="$PROMETHEUS_ENABLE"
77+
if ! is_set "$PROMETHEUS_ENABLE" && is_set "$GRAFANA_ENABLE"; then
78+
prom_install_msg="false 👈 but will install prometheus because grafana is enabled"
79+
fi
80+
7681
cat <<-EOF
7782
7883
Configuration
@@ -84,8 +89,8 @@ print_config() {
8489
registry port : $REGISTRY_PORT
8590
8691
Monitoring
87-
* Install Prometheus : $PROMETHEUS_ENABLE
88-
* Install Grafana : $PROMETHEUS_ENABLE
92+
* Install Prometheus : $prom_install_msg
93+
* Install Grafana : $GRAFANA_ENABLE
8994
9095
$cluster_config
9196
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

0 commit comments

Comments
 (0)