Skip to content

Commit 1f950a7

Browse files
committed
remove tilt dependency on envsubst
1 parent cdf1869 commit 1f950a7

File tree

4 files changed

+9
-40
lines changed

4 files changed

+9
-40
lines changed

Diff for: Makefile

+3-11
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ test: manifests generate fmt vet envtest ## Run tests.
117117
e2etest:
118118
make --no-print-directory _e2etest # Workaround to force the flag on Github Action
119119

120-
_e2etest-infra: kind ctlptl tilt kuttl kustomize clusterctl envsubst
120+
_e2etest-infra: kind ctlptl tilt kuttl kustomize clusterctl
121121
@echo -n "LINODE_TOKEN=$(LINODE_TOKEN)" > config/default/.env.linode
122122
$(CTLPTL) apply -f .tilt/ctlptl-config.yaml
123123
$(TILT) ci --timeout 240s -f Tiltfile
124124

125-
_e2etest: manifests generate envsubst _e2etest-infra
125+
_e2etest: manifests generate _e2etest-infra
126126
ROOT_DIR="$(PWD)" $(KUTTL) test --config e2e/kuttl-config.yaml
127127

128128
## --------------------------------------
@@ -255,7 +255,6 @@ KIND ?= $(LOCALBIN)/kind
255255
KUTTL ?= $(LOCALBIN)/kubectl-kuttl
256256
# setup-envtest does not have devbox support so always use CACHE_BIN
257257
ENVTEST ?= $(CACHE_BIN)/setup-envtest
258-
ENVSUBST ?= $(LOCALBIN)/envsubst
259258
HUSKY ?= $(LOCALBIN)/husky
260259
NILAWAY ?= $(LOCALBIN)/nilaway
261260
GOVULNC ?= $(LOCALBIN)/govulncheck
@@ -268,13 +267,12 @@ CONTROLLER_TOOLS_VERSION ?= v0.14.0
268267
TILT_VERSION ?= 0.33.6
269268
KIND_VERSION ?= 0.20.0
270269
KUTTL_VERSION ?= 0.15.0
271-
ENVSUBST_VERSION ?= v1.4.2
272270
HUSKY_VERSION ?= v0.2.16
273271
NILAWAY_VERSION ?= latest
274272
GOVULNC_VERSION ?= v1.0.1
275273

276274
.PHONY: tools
277-
tools: $(KUSTOMIZE) $(CTLPTL) $(CLUSTERCTL) $(CONTROLLER_GEN) $(TILT) $(KIND) $(KUTTL) $(ENVTEST) $(ENVSUBST) $(HUSKY) $(NILAWAY) $(GOVULNC)
275+
tools: $(KUSTOMIZE) $(CTLPTL) $(CLUSTERCTL) $(CONTROLLER_GEN) $(TILT) $(KIND) $(KUTTL) $(ENVTEST) $(HUSKY) $(NILAWAY) $(GOVULNC)
278276

279277
.PHONY: kustomize
280278
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
@@ -324,12 +322,6 @@ envtest: $(ENVTEST) ## Download setup-envtest locally if necessary.
324322
$(ENVTEST): $(LOCALBIN)
325323
GOBIN=$(CACHE_BIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
326324

327-
.PHONY: envsubst
328-
envsubst: $(ENVSUBST) ## Download envsubst locally if necessary.
329-
$(ENVSUBST): $(LOCALBIN)
330-
curl -Lso $(ENVSUBST) https://github.com/a8m/envsubst/releases/download/$(ENVSUBST_VERSION)/envsubst-$(shell uname -s)-$(ARCH)
331-
chmod +x $(ENVSUBST)
332-
333325
.PHONY: husky
334326
husky: $(HUSKY) ## Download husky locally if necessary.
335327
@echo Execute install command to enable git hooks: ./bin/husky install

Diff for: Tiltfile

+5-7
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ local_resource(
1212
cmd='EXP_CLUSTER_RESOURCE_SET=true clusterctl init --addon helm',
1313
)
1414

15-
templated_yaml = local(
16-
'kustomize build config/default | envsubst',
17-
env={'LINODE_TOKEN': os.getenv('LINODE_TOKEN')},
18-
quiet=True,
19-
echo_off=True
20-
)
21-
k8s_yaml(templated_yaml)
15+
manager_yaml = decode_yaml_stream(kustomize("config/default"))
16+
for resource in manager_yaml:
17+
if resource["metadata"]["name"] == "capl-manager-credentials":
18+
resource["stringData"]["apiToken"] = os.getenv('LINODE_TOKEN')
19+
k8s_yaml(encode_yaml_stream(manager_yaml))
2220

2321
k8s_resource(
2422
workload="capl-controller-manager",

Diff for: devbox.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
"kustomize@latest",
1414
"kuttl@latest",
1515
"nilaway@latest",
16-
"tilt@latest",
17-
"envsubst@latest"
16+
"tilt@latest"
1817
],
1918
"shell": {
2019
"init_hook": [],

Diff for: devbox.lock

-20
Original file line numberDiff line numberDiff line change
@@ -61,26 +61,6 @@
6161
}
6262
}
6363
},
64-
"envsubst@latest": {
65-
"last_modified": "2024-01-27T14:55:31Z",
66-
"resolved": "github:NixOS/nixpkgs/160b762eda6d139ac10ae081f8f78d640dd523eb#envsubst",
67-
"source": "devbox-search",
68-
"version": "1.4.2",
69-
"systems": {
70-
"aarch64-darwin": {
71-
"store_path": "/nix/store/0n0xrd9796b8lz0574v4cnl20d1hvhvb-envsubst-1.4.2"
72-
},
73-
"aarch64-linux": {
74-
"store_path": "/nix/store/myjffrm8sfdncjg92n1kcx8p1h7ni2d1-envsubst-1.4.2"
75-
},
76-
"x86_64-darwin": {
77-
"store_path": "/nix/store/gn9537z5k45frrclsvix22l5kf9y8xc2-envsubst-1.4.2"
78-
},
79-
"x86_64-linux": {
80-
"store_path": "/nix/store/1gkyrqqjcsiirx2c7x79bibn9xjb2nla-envsubst-1.4.2"
81-
}
82-
}
83-
},
8464
"go-tools@latest": {
8565
"last_modified": "2024-01-14T03:55:27Z",
8666
"resolved": "github:NixOS/nixpkgs/dd5621df6dcb90122b50da5ec31c411a0de3e538#go-tools",

0 commit comments

Comments
 (0)