Skip to content

Commit

Permalink
remove tilt dependency on envsubst
Browse files Browse the repository at this point in the history
  • Loading branch information
eljohnson92 committed Feb 22, 2024
1 parent cdf1869 commit 1f950a7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 40 deletions.
14 changes: 3 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

## --------------------------------------
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down
12 changes: 5 additions & 7 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions devbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
"kustomize@latest",
"kuttl@latest",
"nilaway@latest",
"tilt@latest",
"envsubst@latest"
"tilt@latest"
],
"shell": {
"init_hook": [],
Expand Down
20 changes: 0 additions & 20 deletions devbox.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 1f950a7

Please sign in to comment.