Skip to content

Commit

Permalink
⚠️ Introduce the sigs.k8s.io/cluster-api/test Go Module
Browse files Browse the repository at this point in the history
Signed-off-by: Vince Prignano <[email protected]>
  • Loading branch information
vincepri committed Jun 3, 2021
1 parent 40841d9 commit c6e62d2
Show file tree
Hide file tree
Showing 10 changed files with 151 additions and 124 deletions.
31 changes: 16 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,17 @@ export DOCKER_CLI_EXPERIMENTAL := enabled
# Full directory of where the Makefile resides
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
EXP_DIR := exp
TOOLS_DIR := hack/tools
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin
BIN_DIR := bin
E2E_FRAMEWORK_DIR := test/framework
CAPD_DIR := test/infrastructure/docker
RELEASE_NOTES_BIN := bin/release-notes
TOOLS_DIR := hack/tools
TOOLS_BIN_DIR := $(TOOLS_DIR)/$(BIN_DIR)
TEST_DIR := test
E2E_FRAMEWORK_DIR := $(TEST_DIR)/framework
CAPD_DIR := $(TEST_DIR)/infrastructure/docker
RELEASE_NOTES_BIN := (BIN_DIR)/release-notes
RELEASE_NOTES := $(TOOLS_DIR)/$(RELEASE_NOTES_BIN)
GO_APIDIFF_BIN := bin/go-apidiff
GO_APIDIFF_BIN := (BIN_DIR)/go-apidiff
GO_APIDIFF := $(TOOLS_DIR)/$(GO_APIDIFF_BIN)
ENVSUBST_BIN := bin/envsubst
ENVSUBST_BIN := (BIN_DIR)/envsubst
ENVSUBST := $(TOOLS_DIR)/$(ENVSUBST_BIN)

export PATH := $(abspath $(TOOLS_BIN_DIR)):$(PATH)
Expand Down Expand Up @@ -143,11 +144,11 @@ test-cover: ## Run tests with code coverage and code generate reports.
.PHONY: docker-build-e2e
docker-build-e2e: ## Rebuild all Cluster API provider images to be used in the e2e tests
make docker-build REGISTRY=gcr.io/k8s-staging-cluster-api PULL_POLICY=IfNotPresent
$(MAKE) -C test/infrastructure/docker docker-build REGISTRY=gcr.io/k8s-staging-cluster-api PULL_POLICY=IfNotPresent
$(MAKE) -C $(CAPD_DIR) docker-build REGISTRY=gcr.io/k8s-staging-cluster-api PULL_POLICY=IfNotPresent

.PHONY: test-e2e
test-e2e: ## Run the e2e tests
$(MAKE) -C test/e2e run
$(MAKE) -C $(TEST_DIR)/e2e run

## --------------------------------------
## Binaries
Expand Down Expand Up @@ -235,7 +236,7 @@ ALL_GENERATE_MODULES = core cabpk kcp
.PHONY: generate
generate: ## Generate code
$(MAKE) generate-manifests generate-go
$(MAKE) -C test/infrastructure/docker generate
$(MAKE) -C $(CAPD_DIR) generate

.PHONY: generate-go
generate-go: ## Runs Go related generate targets
Expand Down Expand Up @@ -362,7 +363,7 @@ generate-manifests-kcp: $(CONTROLLER_GEN)
modules: ## Runs go mod to ensure modules are up to date.
go mod tidy
cd $(TOOLS_DIR); go mod tidy
$(MAKE) -C $(CAPD_DIR) modules
cd $(TEST_DIR); go mod tidy

## --------------------------------------
## Docker
Expand Down Expand Up @@ -523,10 +524,10 @@ release-manifests: $(RELEASE_DIR) $(KUSTOMIZE) ## Builds the manifests to publis
.PHONY: release-manifests-dev
release-manifests-dev: ## Builds the development manifests and copies them in the release folder
# Release CAPD components and add them to the release dir
$(MAKE) -C test/infrastructure/docker/ release
cp test/infrastructure/docker/out/infrastructure-components.yaml $(RELEASE_DIR)/infrastructure-components-development.yaml
$(MAKE) -C $(CAPD_DIR) release
cp $(CAPD_DIR)/out/infrastructure-components.yaml $(RELEASE_DIR)/infrastructure-components-development.yaml
# Adds CAPD templates
cp test/infrastructure/docker/templates/* $(RELEASE_DIR)/
cp $(CAPD_DIR)/templates/* $(RELEASE_DIR)/

release-binaries: ## Builds the binaries to publish with a release
RELEASE_BINARY=./cmd/clusterctl GOOS=linux GOARCH=amd64 $(MAKE) release-binary
Expand Down Expand Up @@ -599,7 +600,7 @@ clean-book: ## Remove all generated GitBook files
.PHONY: clean-manifests ## Reset manifests in config directories back to master
clean-manifests:
@read -p "WARNING: This will reset all config directories to local master. Press [ENTER] to continue."
git checkout master config bootstrap/kubeadm/config controlplane/kubeadm/config test/infrastructure/docker/config
git checkout master config bootstrap/kubeadm/config controlplane/kubeadm/config $(CAPD_DIR)/config

.PHONY: format-tiltfile
format-tiltfile: ## Format Tiltfile
Expand Down
8 changes: 8 additions & 0 deletions docs/book/src/developer/providers/v1alpha3-to-v1alpha4.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@

- The KIND version used for this release is v0.11.x

## :warning: Go Module changes :warning:

- The `test` folder now ships with its own Go module `sigs.k8s.io/cluster-api/test`.
- The module is going to be tagged and versioned as part of the release.
- Folks importing the test e2e framework or the docker infrastructure provider need to import the new module.
- When imported, the test module version should always match the Cluster API one.
- The CAPD go module in test/infrastructure/docker has been removed.

## Upgrade kube-rbac-proxy to v0.8.0

- Find and replace the `kube-rbac-proxy` version (usually the image is `gcr.io/kubebuilder/kube-rbac-proxy`) and update it to `v0.8.0`.
Expand Down
12 changes: 8 additions & 4 deletions docs/developer/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,14 @@ export DOCKER_CLI_EXPERIMENTAL=enabled

For version v0.x.y:

1. Create an annotated tag `git tag -a v0.x.y -m v0.x.y`
1. To use your GPG signature when pushing the tag, use `git tag -s [...]` instead
1. Push the tag to the GitHub repository `git push origin v0.x.y`
1. NB: `origin` should be the name of the remote pointing to `github.com/kubernetes-sigs/cluster-api`
1. Create an annotated tag
> NOTE: To use your GPG signature when pushing the tag, use `git tag -s [...]` instead)
- `git tag -a v0.x.y -m v0.x.y`
- `git tag -a test/v0.x.y -m test/v0.x.y`
1. Push the tag to the GitHub repository
> NOTE: `origin` should be the name of the remote pointing to `github.com/kubernetes-sigs/cluster-api`
- `git push origin v0.x.y`
- `git push origin test/v0.x.y`
1. Run `make release` to build artifacts (the image is automatically built by CI)
1. Follow the [Image Promotion process](https://git.k8s.io/k8s.io/k8s.gcr.io#image-promoter) to promote the image from the staging repo to `k8s.gcr.io/cluster-api`
1. Create a release in GitHub based on the tag created above
Expand Down
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ require (
k8s.io/component-base v0.21.1
k8s.io/klog/v2 v2.8.0
k8s.io/kubectl v0.21.1
k8s.io/utils v0.0.0-20210517184530-5a248b5acedc
sigs.k8s.io/controller-runtime v0.9.0-beta.6
sigs.k8s.io/kind v0.11.0
k8s.io/utils v0.0.0-20210305010621-2afb4311ab10
sigs.k8s.io/controller-runtime v0.9.0-beta.5
sigs.k8s.io/yaml v1.2.0
)
Loading

0 comments on commit c6e62d2

Please sign in to comment.