File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff 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 '
112112import sys
113113from pathlib import Path
114114
@@ -124,17 +124,14 @@ if not values_path.exists():
124124with 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
134130if isinstance(replicas, int) and replicas >= 0:
135131 print(replicas)
136- else:
137- raise SystemExit(1)
132+ raise SystemExit(0)
133+
134+ raise SystemExit(1)
138135PY
139136)
140137 local status=$?
You can’t perform that action at this time.
0 commit comments