Skip to content

Commit

Permalink
Merge pull request #3052 from chrischdi/pr-drop-overrides-dir
Browse files Browse the repository at this point in the history
🌱 Makefile: drop OVERRIDES_DIR and dependent make targets
  • Loading branch information
k8s-ci-robot authored Jun 17, 2024
2 parents 58b08d8 + f44862c commit 77770c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
17 changes: 0 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,6 @@ SUPERVISOR_WEBHOOK_ROOT ?= $(MANIFEST_ROOT)/supervisor/webhook
RBAC_ROOT ?= $(MANIFEST_ROOT)/rbac
VCSIM_RBAC_ROOT ?= $(VCSIM_DIR)/config/rbac
NETOP_RBAC_ROOT ?= $(NETOP_DIR)/config/rbac
VERSION ?= $(shell cat clusterctl-settings.json | jq .config.nextVersion -r)
OVERRIDES_DIR := $(HOME)/.cluster-api/overrides/infrastructure-vsphere/$(VERSION)

JANITOR_DIR ?= ./$(TOOLS_DIR)/janitor

Expand Down Expand Up @@ -696,10 +694,6 @@ $(RELEASE_NOTES_DIR):
$(BUILD_DIR):
@mkdir -p $(BUILD_DIR)

.PHONY: $(OVERRIDES_DIR)
$(OVERRIDES_DIR):
@mkdir -p $(OVERRIDES_DIR)

.PHONY: release
release: clean-release ## Builds release manifests based on $(PROD_REGISTRY) and $(RELEASE_TAG) into $(RELEASE_DIR)
@if [ -z "${RELEASE_TAG}" ]; then echo "RELEASE_TAG is not set"; exit 1; fi
Expand All @@ -715,13 +709,6 @@ release-manifests-all: ## Builds release manifests into $(RELEASE_DIR)
## Build the manifests into $(RELEASE_DIR)
$(MAKE) release-manifests STAGE=release MANIFEST_DIR=$(RELEASE_DIR)

.PHONY: dev-manifests
dev-manifests: ## Builds dev manifests based on $(REGISTRY) and $(TAG) into the $(OVERRIDES_DIR)
# Set the manifest image to $(REGISTRY)/$(IMAGE_NAME):$(TAG) and pull policy to Always.
$(MAKE) manifest-modification REGISTRY=$(REGISTRY) RELEASE_TAG=$(TAG) PULL_POLICY=Always
## Build the manifests into $(OVERRIDES_DIR)
$(MAKE) release-manifests STAGE=dev MANIFEST_DIR=$(OVERRIDES_DIR)

.PHONY: manifest-modification
manifest-modification: $(BUILD_DIR) # Set the manifest images to $(REGISTRY)/$(IMAGE_NAME):$(RELEASE_TAG) and pull policy to $(PULL_POLICY)
rm -rf $(BUILD_DIR)/config
Expand All @@ -743,10 +730,6 @@ release-manifests: $(BUILD_DIR) $(MANIFEST_DIR) $(KUSTOMIZE) $(STAGE)-flavors ##
release-flavors: $(RELEASE_DIR)
$(MAKE) generate-flavors FLAVOR_DIR=$(RELEASE_DIR)

.PHONY: dev-flavors ## Create dev flavor manifests
dev-flavors: $(OVERRIDES_DIR)
$(MAKE) generate-flavors FLAVOR_DIR=$(OVERRIDES_DIR)

.PHONY: e2e-flavors ## Create dev flavor manifests for e2e testing
e2e-flavors: $(KUSTOMIZE) $(addprefix e2e-flavors-, main)

Expand Down
10 changes: 6 additions & 4 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ make docker-push-all ALL_ARCH=$(go env GOARCH)

Overrides need to be placed in `~/.cluster-api/overrides/infrastructure-vsphere/{version}`

Running the following generates these overrides for you:
Running the following re-generates the manifests for you and copies them over:

``` shell
make dev-manifests
mkdir -p "~/.cluster-api/overrides/infrastructure-vsphere/$(cat clusterctl-settings.json | jq .config.nextVersion -r)"
make manifest-modification REGISTRY=$(REGISTRY) RELEASE_TAG=$(TAG) PULL_POLICY=Always
make release-manifests STAGE=dev MANIFEST_DIR="~/.cluster-api/overrides/infrastructure-vsphere/$(cat clusterctl-settings.json | jq .config.nextVersion -r)"
```

For development purposes, if you are using a `major.minor.x` version (see env variable VERSION) which is not present in the `metadata.yml`, include this version entry along with the API contract in the file.
Expand All @@ -95,8 +97,8 @@ After publishing your test image and generating the manifests, you can use

#### Using custom cluster-templates

In order to generate a custom `custom-template.yaml`, run `make dev-flavors`.
This command will generate a `cluster-template.yaml` at and the logs will mention the path where this file is generated. On mac it will look something like this - `/Users/<user>/.cluster-api/overrides/infrastructure-vsphere/v0.x.0/cluster-template.yaml`.
In order to generate a custom `custom-template.yaml`, run `make generate-flavors`.
This command will generate all flavors in the `templates` directory.
To create this custom cluster, use `clusterctl generate cluster --from="<cluster_template_path>" <cluster_name>`

## Testing e2e
Expand Down

0 comments on commit 77770c0

Please sign in to comment.