Skip to content

Commit 6edf5c9

Browse files
authored
Fix CI test failures that were based on v1alpha1 tests (#280)
Signed-off-by: Stephen Augustus <[email protected]>
1 parent c70301d commit 6edf5c9

File tree

47 files changed

+696
-231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+696
-231
lines changed

Makefile

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
# If you update this file, please follow
1616
# https://suva.sh/posts/well-documented-makefiles
1717

18+
# Ensure Make is run with bash shell as some syntax below is bash-specific
19+
SHELL:=/usr/bin/env bash
20+
1821
.DEFAULT_GOAL:=help
1922

2023
# Use GOPROXY environment variable if set
@@ -27,13 +30,6 @@ export GOPROXY
2730
# Active module mode, as we use go modules to manage dependencies
2831
export GO111MODULE=on
2932

30-
# Default timeout for starting/stopping the Kubebuilder test control plane
31-
export KUBEBUILDER_CONTROLPLANE_START_TIMEOUT ?=60s
32-
export KUBEBUILDER_CONTROLPLANE_STOP_TIMEOUT ?=60s
33-
34-
# This option is for running docker manifest command
35-
export DOCKER_CLI_EXPERIMENTAL := enabled
36-
3733
# Directories.
3834
TOOLS_DIR := hack/tools
3935
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin
@@ -44,6 +40,7 @@ CLUSTERCTL := $(BIN_DIR)/clusterctl
4440
CONTROLLER_GEN := $(TOOLS_BIN_DIR)/controller-gen
4541
GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint
4642
MOCKGEN := $(TOOLS_BIN_DIR)/mockgen
43+
CONVERSION_GEN := $(TOOLS_BIN_DIR)/conversion-gen
4744

4845
# Define Docker related variables. Releases should modify and double check these vars.
4946
REGISTRY ?= gcr.io/$(shell gcloud config get-value project)
@@ -60,7 +57,6 @@ MANIFEST_ROOT ?= config
6057
CRD_ROOT ?= $(MANIFEST_ROOT)/crd/bases
6158
WEBHOOK_ROOT ?= $(MANIFEST_ROOT)/webhook
6259
RBAC_ROOT ?= $(MANIFEST_ROOT)/rbac
63-
CLUSTER_NAME ?= test1
6460

6561
## --------------------------------------
6662
## Help
@@ -112,6 +108,9 @@ $(GOLANGCI_LINT): $(TOOLS_DIR)/go.mod # Build golangci-lint from tools folder.
112108
$(MOCKGEN): $(TOOLS_DIR)/go.mod # Build mockgen from tools folder.
113109
cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/mockgen github.com/golang/mock/mockgen
114110

111+
$(CONVERSION_GEN): $(TOOLS_DIR)/go.mod
112+
cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/conversion-gen k8s.io/code-generator/cmd/conversion-gen
113+
115114

116115
## --------------------------------------
117116
## Linting
@@ -139,12 +138,17 @@ generate: ## Generate code
139138
$(MAKE) generate-manifests
140139

141140
.PHONY: generate-go
142-
generate-go: $(CONTROLLER_GEN) $(MOCKGEN) ## Runs Go related generate targets
141+
generate-go: $(CONTROLLER_GEN) $(MOCKGEN) $(CONVERSION_GEN) ## Runs Go related generate targets
143142
go generate ./...
144143
$(CONTROLLER_GEN) \
145144
paths=./api/... \
146145
object:headerFile=./hack/boilerplate/boilerplate.generatego.txt
147146

147+
$(CONVERSION_GEN) \
148+
--input-dirs=./api/v1alpha2 \
149+
--output-file-base=zz_generated.conversion \
150+
--go-header-file=./hack/boilerplate/boilerplate.generatego.txt
151+
148152
.PHONY: generate-manifests
149153
generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
150154
$(CONTROLLER_GEN) \
@@ -225,7 +229,6 @@ release: clean-release ## Builds and push container images using the latest git
225229
MANIFEST_IMG=$(PROD_REGISTRY)/$(IMAGE_NAME) MANIFEST_TAG=$(RELEASE_TAG) \
226230
$(MAKE) set-manifest-image
227231
$(MAKE) release-manifests
228-
$(MAKE) release-binaries
229232

230233
.PHONY: release-manifests
231234
release-manifests: $(RELEASE_DIR) ## Builds the manifests to publish with a release
@@ -259,7 +262,19 @@ release-tag-latest: ## Adds the latest tag to the last build tag.
259262
## --------------------------------------
260263

261264
.PHONY: create-cluster
262-
create-cluster: $(CLUSTERCTL) ## Create a development Kubernetes cluster on Azure in a KIND management cluster.
265+
create-cluster: $(CLUSTERCTL) ## Create a development Kubernetes cluster on Azure using examples
266+
$(CLUSTERCTL) \
267+
create cluster -v 4 \
268+
--bootstrap-flags="name=clusterapi" \
269+
--bootstrap-type kind \
270+
-m ./examples/_out/controlplane.yaml \
271+
-c ./examples/_out/cluster.yaml \
272+
-p ./examples/_out/provider-components.yaml \
273+
-a ./examples/addons.yaml
274+
275+
276+
.PHONY: create-cluster-management
277+
create-cluster-management: $(CLUSTERCTL) ## Create a development Kubernetes cluster on Azure in a KIND management cluster.
263278
kind create cluster --name=clusterapi
264279
# Apply provider-components.
265280
kubectl \
@@ -337,6 +352,14 @@ clean-examples: ## Remove all the temporary files generated in the examples fold
337352
rm -f examples/provider-components/provider-components-*.yaml
338353

339354
.PHONY: verify
340-
verify: ## Runs verification scripts to ensure correct execution
355+
verify: verify-boilerplate verify-modules
356+
357+
.PHONY: verify-boilerplate
358+
verify-boilerplate:
341359
./hack/verify-boilerplate.sh
342-
./hack/verify-generated-files.sh
360+
361+
.PHONY: verify-modules
362+
verify-modules: modules
363+
@if !(git diff --quiet HEAD -- go.sum go.mod hack/tools/go.mod hack/tools/go.sum); then \
364+
echo "go module files are out of date"; exit 1; \
365+
fi

cloud/mocks/service_mock.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cloud/services/availabilityzones/mock_availabilityzones/availabilityzones_mock.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cloud/services/disks/mock_disks/disks_mock.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cloud/services/groups/mock_groups/groups_mock.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cloud/services/internalloadbalancers/mock_internalloadbalancers/internalloadbalancers_mock.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cloud/services/networkinterfaces/mock_networkinterfaces/networkinterfaces_mock.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cloud/services/publicips/mock_publicips/publicips_mock.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cloud/services/publicloadbalancers/mock_publicloadbalancers/publicloadbalancers_mock.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cloud/services/routetables/mock_routetables/routetables_mock.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)