1
1
# Image URL to use all building/pushing image targets
2
- IMG ?= public.ecr.aws/a4z9h2b1/cluster-api-provider-capc:latest
3
- IMG_LOCAL ?= localhost:5000/cluster-api-provider-cloudstack:latest
2
+ STAGING_REGISTRY := gcr.io/k8s-staging-capi-cloudstack
3
+ REGISTRY ?= $(STAGING_REGISTRY )
4
+ IMAGE_NAME ?= capi-cloudstack-controller
5
+ TAG ?= dev
6
+ IMG ?= $(REGISTRY ) /$(IMAGE_NAME ) :$(TAG )
7
+ IMG_LOCAL ?= localhost:5000/$(IMAGE_NAME ) :$(TAG )
4
8
5
9
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
6
10
ifeq (,$(shell go env GOBIN) )
@@ -45,7 +49,7 @@ help: ## Display this help.
45
49
@awk ' BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST )
46
50
47
51
MANIFEST_GEN_INPUTS =$(shell find ./api ./controllers -type f -name "* test* " -prune -o -name "* zz_generated* " -prune -o -print)
48
-
52
+
49
53
# Using a flag file here as config output is too complicated to be a target.
50
54
# The following triggers manifest building if $(IMG) differs from that found in config/default/manager_image_patch.yaml.
51
55
$(shell grep -qs "$(IMG)" config/default/manager_image_patch_edited.yaml || rm -f config/.flag.mk)
@@ -58,7 +62,7 @@ config/.flag.mk: bin/controller-gen $(MANIFEST_GEN_INPUTS)
58
62
59
63
.PHONY : release-manifests
60
64
RELEASE_MANIFEST_TARGETS =$(RELEASE_DIR ) /infrastructure-components.yaml $(RELEASE_DIR ) /metadata.yaml
61
- RELEASE_MANIFEST_INPUTS =bin/kustomize config/.flag.mk $(shell find config)
65
+ RELEASE_MANIFEST_INPUTS =bin/kustomize config/.flag.mk $(shell find config)
62
66
release-manifests : $(RELEASE_MANIFEST_TARGETS ) # # Create kustomized release manifest in $RELEASE_DIR (defaults to out).
63
67
$(RELEASE_DIR ) /% : $(RELEASE_MANIFEST_INPUTS )
64
68
@mkdir -p $(RELEASE_DIR )
@@ -146,7 +150,7 @@ bin/golangci-lint: ## Install golangci-lint to bin.
146
150
bin/staticcheck : # # Install staticcheck to bin.
147
151
GOBIN=
$(PROJECT_DIR ) /bin go install honnef.co/go/tools/cmd/
[email protected]
148
152
bin/ginkgo : bin/ginkgo_v1 bin/ginkgo_v2 # # Install ginkgo to bin.
149
- bin/ginkgo_v2 :
153
+ bin/ginkgo_v2 :
150
154
GOBIN=
$(PROJECT_DIR ) /bin go install github.com/onsi/ginkgo/v2/
[email protected]
151
155
mv $(PROJECT_DIR ) /bin/ginkgo $(PROJECT_DIR ) /bin/ginkgo_v2
152
156
bin/ginkgo_v1 :
@@ -180,15 +184,15 @@ test: generate-mocks lint bin/ginkgo bin/kubectl bin/kube-apiserver bin/etcd ##
180
184
@# The following is a slightly funky way to make sure the ginkgo statements are removed regardless the test results.
181
185
@ginkgo_v2 --label-filter=" !integ" --cover -coverprofile cover.out --covermode=atomic -v ./api/... ./controllers/... ./pkg/...; EXIT_STATUS=$$? ; \
182
186
./hack/testing_ginkgo_recover_statements.sh --remove; exit $$ EXIT_STATUS
183
-
187
+
184
188
.PHONY : generate-mocks
185
189
generate-mocks : bin/mockgen generate-deepcopy pkg/mocks/mock_client.go $(shell find ./pkg/mocks -type f -name "mock* .go") # # Generate mocks needed for testing. Primarily mocks of the cloud package.
186
190
pkg/mocks/mock% .go : $(shell find ./pkg/cloud -type f -name "* test* " -prune -o -print)
187
191
go generate ./...
188
192
189
193
# #@ Tilt
190
194
191
- .PHONY : tilt-up
195
+ .PHONY : tilt-up
192
196
tilt-up : cluster-api kind-cluster cluster-api/tilt-settings.json manifests cloud-config # # Setup and run tilt for development.
193
197
export CLOUDSTACK_B64ENCODED_SECRET=$$(base64 -w0 -i cloud-config 2>/dev/null || base64 -b 0 -i cloud-config ) && cd cluster-api && tilt up
194
198
0 commit comments