|
1 | 1 | # -*- mode: Python -*- |
2 | 2 |
|
3 | | -kustomize_cmd = "./hack/tools/bin/kustomize" |
4 | 3 | envsubst_cmd = "./hack/tools/bin/envsubst" |
5 | 4 |
|
6 | 5 | update_settings(k8s_upsert_timeout_secs=60) # on first tilt up, often can take longer than 30 seconds |
@@ -152,7 +151,7 @@ COPY manager . |
152 | 151 | # Build CAPZ and add feature gates |
153 | 152 | def capz(): |
154 | 153 | # Apply the kustomized yaml for this provider |
155 | | - yaml = str(kustomize("./config")) |
| 154 | + yaml = str(kustomizesub("./config")) |
156 | 155 | substitutions = settings.get("kustomize_substitutions", {}) |
157 | 156 | for substitution in substitutions: |
158 | 157 | value = substitutions[substitution] |
@@ -200,7 +199,6 @@ def capz(): |
200 | 199 | ignore = ["templates"] |
201 | 200 | ) |
202 | 201 |
|
203 | | - yaml = envsubst(yaml) |
204 | 202 | k8s_yaml(blob(yaml)) |
205 | 203 |
|
206 | 204 |
|
@@ -333,11 +331,14 @@ def base64_decode(to_decode): |
333 | 331 | decode_blob = local("echo '{}' | base64 --decode -".format(to_decode), quiet=True) |
334 | 332 | return str(decode_blob) |
335 | 333 |
|
336 | | - |
337 | 334 | def envsubst(yaml): |
338 | 335 | yaml = yaml.replace('"', '\\"') |
339 | 336 | return str(local("echo \"{}\" | {}".format(yaml, envsubst_cmd), quiet=True)) |
340 | 337 |
|
| 338 | +def kustomizesub(folder): |
| 339 | + yaml = local('hack/kustomize-sub.sh {}'.format(folder), quiet=True) |
| 340 | + return yaml |
| 341 | + |
341 | 342 | ############################## |
342 | 343 | # Actual work happens here |
343 | 344 | ############################## |
|
0 commit comments