File tree Expand file tree Collapse file tree 2 files changed +47
-5
lines changed
pkg/plugins/golang/v4/scaffolds/internal/templates Expand file tree Collapse file tree 2 files changed +47
-5
lines changed Original file line number Diff line number Diff line change @@ -120,4 +120,44 @@ jobs:
120120 - name : Testing make test-e2e for project-v4-multigroup
121121 working-directory : testdata/project-v4-multigroup/
122122 run : |
123- make test-e2e
123+ make test-e2e
124+
125+ # Test to validate e2e integration when no APIs are scaffolded
126+ e2e-test-basic-project :
127+ runs-on : ubuntu-latest
128+ if : github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
129+ steps :
130+ - name : Checkout repository
131+ uses : actions/checkout@v5
132+
133+ - name : Setup Go
134+ uses : actions/setup-go@v5
135+ with :
136+ go-version-file : go.mod
137+
138+ - name : Install the latest version of kind
139+ run : |
140+ curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64
141+ chmod +x ./kind
142+ sudo mv ./kind /usr/local/bin/kind
143+
144+ - name : Verify kind installation
145+ run : kind version
146+
147+ - name : Create kind cluster
148+ run : kind create cluster
149+
150+ - name : Build kubebuilder CLI from this repo
151+ run : make install
152+
153+ - name : Scaffold empty go/v4 project
154+ run : |
155+ mkdir -p /tmp/basic-project-v4
156+ cd /tmp/basic-project-v4
157+ kubebuilder init --plugins go/v4 --domain example.com --repo example.com/empty-operator
158+ go mod tidy
159+ make
160+
161+ - name : Run make test-e2e on empty project
162+ working-directory : /tmp/basic-project-v4
163+ run : CERT_MANAGER_INSTALL_SKIP=true make test-e2e
Original file line number Diff line number Diff line change @@ -232,12 +232,14 @@ ifndef ignore-not-found
232232endif
233233
234234.PHONY: install
235- install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
236- $(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
235+ install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config. No-op if none exist.
236+ @out="$$( $(KUSTOMIZE) build config/crd 2>/dev/null || true )"; \
237+ if [ -n "$$out" ]; then echo "$$out" | $(KUBECTL) apply -f -; else echo "No CRDs to install; skipping."; fi
237238
238239.PHONY: uninstall
239- 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.
240- $(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
240+ 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. No-op if none exist.
241+ @out="$$( $(KUSTOMIZE) build config/crd 2>/dev/null || true )"; \
242+ if [ -n "$$out" ]; then echo "$$out" | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -; else echo "No CRDs to delete; skipping."; fi
241243
242244.PHONY: deploy
243245deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
You can’t perform that action at this time.
0 commit comments