File tree 2 files changed +17
-7
lines changed
2 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -396,13 +396,19 @@ test-cover: ## Run unit and integration tests and generate a coverage report
396
396
397
397
398
398
.PHONY : test-e2e
399
- test-e2e : # # Run "docker-build" and "docker-push" rules then run e2e tests.
399
+ test-e2e : # # Run `docker-build` and `docker-push` rules then run e2e tests.
400
+ PULL_POLICY=IfNotPresent MANAGER_IMAGE=$(CONTROLLER_IMG ) -$(ARCH ) :$(TAG ) \
401
+ $(MAKE ) docker-build docker-push \
402
+ test-e2e-run
403
+
404
+ .PHONY : test-e2e-local
405
+ test-e2e-local : # # Run `docker-build` rule then run e2e tests.
400
406
PULL_POLICY=IfNotPresent MANAGER_IMAGE=$(CONTROLLER_IMG ) -$(ARCH ) :$(TAG ) \
401
407
$(MAKE ) docker-build docker-push \
402
408
test-e2e-run
403
409
404
410
.PHONY : test-e2e-run-skip-manifest
405
- test-e2e-run-skip-manifest : $(GINKGO ) $(ENVSUBST ) generate-e2e-templates # # Run the end-to-end tests
411
+ test-e2e-run-skip-manifest : $(GINKGO ) $(ENVSUBST ) generate-e2e-templates # # Run the end-to-end tests without updating the manifest.
406
412
$(ENVSUBST ) < $(E2E_CONF_FILE ) > $(E2E_CONF_FILE_ENVSUBST ) && \
407
413
$(GINKGO ) -v --trace -poll-progress-after=$(GINKGO_POLL_PROGRESS_AFTER ) \
408
414
-poll-progress-interval=$(GINKGO_POLL_PROGRESS_INTERVAL ) --tags=e2e --focus=" $( GINKGO_FOCUS) " \
@@ -413,7 +419,7 @@ test-e2e-run-skip-manifest: $(GINKGO) $(ENVSUBST) generate-e2e-templates ## Run
413
419
-e2e.skip-resource-cleanup=$(SKIP_RESOURCE_CLEANUP ) -e2e.use-existing-cluster=$(USE_EXISTING_CLUSTER )
414
420
415
421
.PHONY : test-e2e-run
416
- test-e2e-run :
422
+ test-e2e-run : # # Run the end-to-end tests and set controller image and pull policy in the manifest.
417
423
$(MAKE ) set-manifest-image MANIFEST_IMG=$(CONTROLLER_IMG ) -$(ARCH ) MANIFEST_TAG=$(TAG ) TARGET_RESOURCE=" ./config/default/manager_image_patch.yaml"
418
424
$(MAKE ) set-manifest-pull-policy TARGET_RESOURCE=" ./config/default/manager_pull_policy.yaml" PULL_POLICY=IfNotPresent
419
425
MANAGER_IMAGE=$(CONTROLLER_IMG ) -$(ARCH ) :$(TAG ) \
Original file line number Diff line number Diff line change @@ -25,11 +25,12 @@ REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
25
25
# shellcheck source=hack/ensure-go.sh
26
26
source " ${REPO_ROOT} /hack/ensure-go.sh"
27
27
28
- export LOCAL_ONLY=${LOCAL_ONLY:- " true" }
29
- export USE_LOCAL_KIND_REGISTRY=${USE_LOCAL_KIND_REGISTRY:- ${LOCAL_ONLY} }
28
+ export USE_LOCAL_KIND_REGISTRY=${USE_LOCAL_KIND_REGISTRY:- " true" }
30
29
export BUILD_MANAGER_IMAGE=${BUILD_MANAGER_IMAGE:- " true" }
31
30
32
- export REGISTRY=${REGISTRY:- " localhost:5000/ci-e2e" }
31
+ if [[ " ${USE_LOCAL_KIND_REGISTRY} " == " true" ]]; then
32
+ export REGISTRY=" localhost:5000/ci-e2e"
33
+ fi
33
34
34
35
if [[ " ${BUILD_MANAGER_IMAGE} " == " true" ]]; then
35
36
defaultTag=$( date -u ' +%Y%m%d%H%M%S' )
@@ -41,7 +42,10 @@ export GINKGO_NODES=10
41
42
# Image is configured as `${CONTROLLER_IMG}-${ARCH}:${TAG}` where `CONTROLLER_IMG` is defaulted to `${REGISTRY}/${IMAGE_NAME}`.
42
43
if [[ " ${BUILD_MANAGER_IMAGE} " == " false" ]]; then
43
44
# Load an existing image, skip docker-build and docker-push.
44
- make test-e2e-run
45
+ make test-e2e-skip-build-and-push
46
+ elif [[ " ${USE_LOCAL_KIND_REGISTRY} " == " true" ]]; then
47
+ # Build an image with kind local registry, skip docker-push. REGISTRY is set to `localhost:5000/ci-e2e`. TAG is set to `$(date -u '+%Y%m%d%H%M%S')`.
48
+ make test-e2e-local
45
49
else
46
50
# Build an image and push to the registry. TAG is set to `$(date -u '+%Y%m%d%H%M%S')`.
47
51
make test-e2e
You can’t perform that action at this time.
0 commit comments