Skip to content

Commit 54bb062

Browse files
sbueringerk8s-ci-robot
authored andcommitted
remove vendor folder, upgrade to capi v0.2.0. re-sync makefile (#457)
1 parent 7e4e4a8 commit 54bb062

File tree

2,914 files changed

+45
-1044849
lines changed

Some content is hidden

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

2,914 files changed

+45
-1044849
lines changed

Makefile

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
# If you update this file, please follow:
16-
# https://suva.sh/posts/well-documented-makefiles/
15+
# If you update this file, please follow
16+
# https://suva.sh/posts/well-documented-makefiles
1717

1818
# Ensure Make is run with bash shell as some syntax below is bash-specific
1919
SHELL:=/usr/bin/env bash
@@ -42,8 +42,11 @@ GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint
4242
MOCKGEN := $(TOOLS_BIN_DIR)/mockgen
4343

4444
# Define Docker related variables. Releases should modify and double check these vars.
45-
REGISTRY ?= k8scloudprovider
46-
CONTROLLER_IMG ?= $(REGISTRY)/cluster-api-openstack-controller
45+
REGISTRY ?= gcr.io/$(shell gcloud config get-value project)
46+
STAGING_REGISTRY := gcr.io/k8s-staging-cluster-api-openstack
47+
PROD_REGISTRY := us.gcr.io/k8s-artifacts-prod/cluster-api-openstack
48+
IMAGE_NAME ?= cluster-api-openstack-controller
49+
CONTROLLER_IMG ?= $(REGISTRY)/$(IMAGE_NAME)
4750
TAG ?= dev
4851
ARCH ?= amd64
4952
ALL_ARCH = amd64 arm arm64 ppc64le s390x
@@ -64,7 +67,7 @@ HAS_ENVSUBST := $(shell command -v envsubst;)
6467
## --------------------------------------
6568

6669
help: ## Display this help
67-
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
70+
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
6871

6972
## --------------------------------------
7073
## Define targets for prow
@@ -88,9 +91,9 @@ test: generate lint ## Run tests
8891

8992
.PHONY: test-go
9093
test-go: ## Run golang tests
91-
go test -v ./api/... ./pkg/... ./controllers/...
92-
# TODO change to ./... as soon as vendor is removed
94+
go test -v ./...
9395

96+
.PHONY: test-generate-examples
9497
test-generate-examples:
9598
ifndef HAS_YQ
9699
echo "installing yq"
@@ -165,14 +168,13 @@ generate: ## Generate code
165168

166169
.PHONY: generate-go
167170
generate-go: $(CONTROLLER_GEN) $(MOCKGEN) ## Runs Go related generate targets
168-
go generate ./pkg/... ./cmd/...
169-
# TODO change to ./.. as soon as vendor is removed
171+
go generate ./...
170172
$(CONTROLLER_GEN) \
171173
paths=./api/... \
172174
object:headerFile=./hack/boilerplate.go.txt
173175

174176
.PHONY: generate-manifests
175-
generate-manifests: ## Generate manifests e.g. CRD, RBAC etc.
177+
generate-manifests: $(CONTROLLER_GEN) ## Generate manifests e.g. CRD, RBAC etc.
176178
$(CONTROLLER_GEN) \
177179
paths=./api/... \
178180
crd:trivialVersions=true \
@@ -223,6 +225,7 @@ docker-push-manifest: ## Push the fat manifest docker image.
223225
## Minimum docker version 18.06.0 is required for creating and pushing manifest images.
224226
docker manifest create --amend $(CONTROLLER_IMG):$(TAG) $(shell echo $(ALL_ARCH) | sed -e "s~[^ ]*~$(CONTROLLER_IMG)\-&:$(TAG)~g")
225227
@for arch in $(ALL_ARCH); do docker manifest annotate --arch $${arch} ${CONTROLLER_IMG}:${TAG} ${CONTROLLER_IMG}-$${arch}:${TAG}; done
228+
docker manifest push --purge ${CONTROLLER_IMG}:${TAG}
226229
MANIFEST_IMG=$(CONTROLLER_IMG) MANIFEST_TAG=$(TAG) $(MAKE) set-manifest-image
227230

228231
.PHONY: set-manifest-image
@@ -231,7 +234,7 @@ set-manifest-image:
231234
sed -i'' -e 's@image: .*@image: '"${MANIFEST_IMG}:$(MANIFEST_TAG)"'@' ./config/default/manager_image_patch.yaml
232235

233236
## --------------------------------------
234-
## Release TODO(sbueringer): just copied over from CAPA right now, have to implement that for OpenStack
237+
## Release
235238
## --------------------------------------
236239

237240
RELEASE_TAG := $(shell git describe --abbrev=0 2>/dev/null)
@@ -240,18 +243,18 @@ RELEASE_TAG := $(shell git describe --abbrev=0 2>/dev/null)
240243
release: ## Builds and push container images using the latest git tag for the commit.
241244
@if [ -z "${RELEASE_TAG}" ]; then echo "RELEASE_TAG is not set"; exit 1; fi
242245
# Push the release image to the staging bucket first.
243-
REGISTRY=gcr.io/k8s-staging-cluster-api-openstack TAG=$(RELEASE_TAG) \
246+
REGISTRY=$(STAGING_REGISTRY) TAG=$(RELEASE_TAG) \
244247
$(MAKE) docker-build-all docker-push-all
245248
# Set the manifest image to the production bucket.
246-
REGISTRY=us.gcr.io/k8s-artifacts-prod/cluster-api-openstack TAG=$(RELEASE_TAG) \
247-
set-manifest-image
249+
MANIFEST_IMG=$(PROD_REGISTRY)/$(IMAGE_NAME) MANIFEST_TAG=$(RELEASE_TAG) \
250+
$(MAKE) set-manifest-image
248251
# Generate release artifacts.
249252
mkdir -p out/
250253
kustomize build config/default > out/infrastructure-components.yaml
251254

252255
.PHONY: release-staging-latest
253256
release-staging-latest: ## Builds and push container images to the staging bucket using "latest" tag.
254-
REGISTRY=gcr.io/k8s-staging-cluster-api-openstack TAG=latest \
257+
REGISTRY=$(STAGING_REGISTRY) TAG=latest \
255258
$(MAKE) docker-build-all docker-push-all
256259

257260
## --------------------------------------
@@ -269,6 +272,7 @@ create-cluster: $(CLUSTERCTL) ## Create a development Kubernetes cluster on Open
269272
-p ./examples/_out/provider-components.yaml \
270273
-a ./examples/addons.yaml
271274

275+
272276
.PHONY: create-cluster-management
273277
create-cluster-management: $(CLUSTERCTL) ## Create a development Kubernetes cluster on OpenStack in a KIND management cluster.
274278
kind create cluster --name=clusterapi
@@ -298,7 +302,7 @@ create-cluster-management: $(CLUSTERCTL) ## Create a development Kubernetes clus
298302
# Create a worker node with MachineDeployment.
299303
kubectl \
300304
--kubeconfig=$$(kind get kubeconfig-path --name="clusterapi") \
301-
create -f examples/_out/worker.yaml
305+
create -f examples/_out/machinedeployment.yaml
302306

303307
.PHONY: delete-cluster
304308
delete-cluster: $(CLUSTERCTL) ## Deletes the development Kubernetes Cluster "test1"

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ require (
1414
k8s.io/apimachinery v0.0.0-20190711103026-7bf792636534
1515
k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible
1616
k8s.io/klog v0.4.0
17-
k8s.io/utils v0.0.0-20190506122338-8fab8cb257d5
18-
sigs.k8s.io/cluster-api v0.0.0-20190826164421-9a520827870a
17+
k8s.io/utils v0.0.0-20190809000727-6c36bc71fc4a
18+
sigs.k8s.io/cluster-api v0.2.0
1919
sigs.k8s.io/controller-runtime v0.2.0
2020
)
2121

2222
replace (
2323
k8s.io/api => k8s.io/api v0.0.0-20190704095032-f4ca3d3bdf1d
2424
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20190704094733-8f6ac2502e51
25-
sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v0.0.0-20190826164421-9a520827870a
25+
sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v0.2.0
2626
)

0 commit comments

Comments
 (0)