Skip to content

Commit ff329d9

Browse files
committed
Fix syntax
1 parent 3540cad commit ff329d9

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

helm-chart/test-chart.sh

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ get_desired_app_replicas() {
108108
if command -v python3 >/dev/null 2>&1; then
109109
set +e
110110
local parsed
111-
parsed=$(python3 <<'PY' "$values_path" 2>/dev/null)
111+
parsed=$(python3 - "$values_path" 2>/dev/null <<'PY'
112112
import sys
113113
from pathlib import Path
114114
@@ -124,17 +124,14 @@ if not values_path.exists():
124124
with values_path.open('r', encoding='utf-8') as fh:
125125
data = yaml.safe_load(fh) or {}
126126
127-
replicas = data
128-
for key in ("app",):
129-
replicas = replicas.get(key, {}) if isinstance(replicas, dict) else {}
130-
131-
if isinstance(replicas, dict):
132-
replicas = replicas.get("replicaCount")
127+
replicas = data.get("app", {}) if isinstance(data, dict) else {}
128+
replicas = replicas.get("replicaCount") if isinstance(replicas, dict) else None
133129
134130
if isinstance(replicas, int) and replicas >= 0:
135131
print(replicas)
136-
else:
137-
raise SystemExit(1)
132+
raise SystemExit(0)
133+
134+
raise SystemExit(1)
138135
PY
139136
)
140137
local status=$?

0 commit comments

Comments
 (0)