Skip to content

Commit 57dba4e

Browse files
author
Richard Kovacs
committed
Use Tilt for provisioning on CI
1 parent 223d4ab commit 57dba4e

File tree

6 files changed

+18
-23
lines changed

6 files changed

+18
-23
lines changed

.github/workflows/build_test_ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,17 @@ jobs:
132132

133133
- name: E2E test
134134
run: make e2etest
135+
env:
136+
GITHUB_TOKEN: ${{ secrets.github_token }}
137+
138+
- name: Copy logs
139+
run: docker cp tilt-control-plane:/var/log .logs
135140

136141
- uses: actions/upload-artifact@v4
137142
if: ${{ always() }}
138143
with:
139-
name: kind-logs
140-
path: .kind/kind-logs-*
144+
name: logs
145+
path: .logs/*
141146

142147
docker-build:
143148
runs-on: ubuntu-latest

.husky/hooks/pre-push

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if git status --short | grep -qv "??"; then
1313
trap unstash EXIT
1414
fi
1515

16-
make generate manifests _setImage
16+
make generate manifests
1717
git diff --exit-code --quiet || (git status && exit 1)
1818

1919
make lint gosec nilcheck test

.tilt/ctlptl-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
apiVersion: ctlptl.dev/v1alpha1
33
kind: Cluster
44
product: kind
5+
registry: ctlptl-registry
56
kindV1Alpha4Cluster:
67
name: tilt
78
nodes:

Makefile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ test: manifests generate fmt vet envtest ## Run tests.
8989
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test -race -timeout 60s ./... -coverprofile cover.out
9090

9191
.PHONY: e2etest
92-
e2etest: kind kuttl kustomize clusterctl manifests generate docker-build
92+
e2etest: kind ctlptl tilt kuttl kustomize clusterctl manifests generate
9393
@echo -n "LINODE_TOKEN=$(LINODE_TOKEN)" > config/default/.env.linode
94-
@$(CONTAINER_TOOL) tag ${IMG} capli-controller:e2e
95-
IMG=capli-controller:e2e $(KUTTL) test --config e2e/kuttl-config.yaml
96-
make _setImage
94+
$(CTLPTL) apply -f .tilt/ctlptl-config.yaml
95+
$(TILT) ci --timeout 120s -f Tiltfile
96+
$(KUTTL) test --config e2e/kuttl-config.yaml
9797

9898
##@ Build
9999

@@ -147,11 +147,9 @@ install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~
147147
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
148148
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
149149

150-
_setImage: kustomize
151-
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
152-
153150
.PHONY: deploy
154-
deploy: manifests kustomize _setImage ## Deploy controller to the K8s cluster specified in ~/.kube/config.
151+
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
152+
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
155153
$(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
156154

157155
.PHONY: undeploy

Tiltfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
docker_build("controller", ".", only=("vendor","go.mod", "go.sum", "./api", "./cloud","./cmd", "./controller", "./util"))
1+
docker_build("controller", ".", only=("Dockerfile", "Makefile", "vendor","go.mod", "go.sum", "./api", "./cloud","./cmd", "./controller", "./util"))
22

33
local_resource(
4-
'capi-controller-manager',
5-
cmd='clusterctl init',
4+
'capi-controller-manager',
5+
cmd='clusterctl init',
66
)
77

88
k8s_yaml(kustomize('config/default'))

e2e/kuttl-config.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,4 @@ kind: TestSuite
33
testDirs:
44
- e2e/basic
55
kindConfig: e2e/kind-config.yaml
6-
kindContext: kuttl
7-
startKIND: true
8-
kindNodeCache: true
9-
kindContainers:
10-
- capli-controller:e2e
11-
artifactsDir: .kind
126
timeout: 120
13-
commands:
14-
- command: clusterctl init
15-
- command: make deploy

0 commit comments

Comments
 (0)