diff --git a/Makefile b/Makefile index dca7b3d9f..fbbd06fda 100644 --- a/Makefile +++ b/Makefile @@ -117,12 +117,12 @@ test: manifests generate fmt vet envtest ## Run tests. e2etest: make --no-print-directory _e2etest # Workaround to force the flag on Github Action -_e2etest-infra: kind ctlptl tilt kuttl kustomize clusterctl envsubst +_e2etest-infra: kind ctlptl tilt kuttl kustomize clusterctl @echo -n "LINODE_TOKEN=$(LINODE_TOKEN)" > config/default/.env.linode $(CTLPTL) apply -f .tilt/ctlptl-config.yaml $(TILT) ci --timeout 240s -f Tiltfile -_e2etest: manifests generate envsubst _e2etest-infra +_e2etest: manifests generate _e2etest-infra ROOT_DIR="$(PWD)" $(KUTTL) test --config e2e/kuttl-config.yaml ## -------------------------------------- @@ -255,7 +255,6 @@ KIND ?= $(LOCALBIN)/kind KUTTL ?= $(LOCALBIN)/kubectl-kuttl # setup-envtest does not have devbox support so always use CACHE_BIN ENVTEST ?= $(CACHE_BIN)/setup-envtest -ENVSUBST ?= $(LOCALBIN)/envsubst HUSKY ?= $(LOCALBIN)/husky NILAWAY ?= $(LOCALBIN)/nilaway GOVULNC ?= $(LOCALBIN)/govulncheck @@ -268,13 +267,12 @@ CONTROLLER_TOOLS_VERSION ?= v0.14.0 TILT_VERSION ?= 0.33.6 KIND_VERSION ?= 0.20.0 KUTTL_VERSION ?= 0.15.0 -ENVSUBST_VERSION ?= v1.4.2 HUSKY_VERSION ?= v0.2.16 NILAWAY_VERSION ?= latest GOVULNC_VERSION ?= v1.0.1 .PHONY: tools -tools: $(KUSTOMIZE) $(CTLPTL) $(CLUSTERCTL) $(CONTROLLER_GEN) $(TILT) $(KIND) $(KUTTL) $(ENVTEST) $(ENVSUBST) $(HUSKY) $(NILAWAY) $(GOVULNC) +tools: $(KUSTOMIZE) $(CTLPTL) $(CLUSTERCTL) $(CONTROLLER_GEN) $(TILT) $(KIND) $(KUTTL) $(ENVTEST) $(HUSKY) $(NILAWAY) $(GOVULNC) .PHONY: kustomize kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. @@ -324,12 +322,6 @@ envtest: $(ENVTEST) ## Download setup-envtest locally if necessary. $(ENVTEST): $(LOCALBIN) GOBIN=$(CACHE_BIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest -.PHONY: envsubst -envsubst: $(ENVSUBST) ## Download envsubst locally if necessary. -$(ENVSUBST): $(LOCALBIN) - curl -Lso $(ENVSUBST) https://github.com/a8m/envsubst/releases/download/$(ENVSUBST_VERSION)/envsubst-$(shell uname -s)-$(ARCH) - chmod +x $(ENVSUBST) - .PHONY: husky husky: $(HUSKY) ## Download husky locally if necessary. @echo Execute install command to enable git hooks: ./bin/husky install diff --git a/Tiltfile b/Tiltfile index d300d4722..dd82106ed 100644 --- a/Tiltfile +++ b/Tiltfile @@ -12,13 +12,11 @@ local_resource( cmd='EXP_CLUSTER_RESOURCE_SET=true clusterctl init --addon helm', ) -templated_yaml = local( - 'kustomize build config/default | envsubst', - env={'LINODE_TOKEN': os.getenv('LINODE_TOKEN')}, - quiet=True, - echo_off=True -) -k8s_yaml(templated_yaml) +manager_yaml = decode_yaml_stream(kustomize("config/default")) +for resource in manager_yaml: + if resource["metadata"]["name"] == "capl-manager-credentials": + resource["stringData"]["apiToken"] = os.getenv('LINODE_TOKEN') +k8s_yaml(encode_yaml_stream(manager_yaml)) k8s_resource( workload="capl-controller-manager", diff --git a/devbox.json b/devbox.json index 846dffc1b..d983179b3 100644 --- a/devbox.json +++ b/devbox.json @@ -13,8 +13,7 @@ "kustomize@latest", "kuttl@latest", "nilaway@latest", - "tilt@latest", - "envsubst@latest" + "tilt@latest" ], "shell": { "init_hook": [], diff --git a/devbox.lock b/devbox.lock index a821f601b..77faddac2 100644 --- a/devbox.lock +++ b/devbox.lock @@ -61,26 +61,6 @@ } } }, - "envsubst@latest": { - "last_modified": "2024-01-27T14:55:31Z", - "resolved": "github:NixOS/nixpkgs/160b762eda6d139ac10ae081f8f78d640dd523eb#envsubst", - "source": "devbox-search", - "version": "1.4.2", - "systems": { - "aarch64-darwin": { - "store_path": "/nix/store/0n0xrd9796b8lz0574v4cnl20d1hvhvb-envsubst-1.4.2" - }, - "aarch64-linux": { - "store_path": "/nix/store/myjffrm8sfdncjg92n1kcx8p1h7ni2d1-envsubst-1.4.2" - }, - "x86_64-darwin": { - "store_path": "/nix/store/gn9537z5k45frrclsvix22l5kf9y8xc2-envsubst-1.4.2" - }, - "x86_64-linux": { - "store_path": "/nix/store/1gkyrqqjcsiirx2c7x79bibn9xjb2nla-envsubst-1.4.2" - } - } - }, "go-tools@latest": { "last_modified": "2024-01-14T03:55:27Z", "resolved": "github:NixOS/nixpkgs/dd5621df6dcb90122b50da5ec31c411a0de3e538#go-tools",