Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

build: Specify CAPI provider versions from go module versions #47

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hack/examples/bases/docker/cluster/kustomization.yaml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- https://github.com/kubernetes-sigs/cluster-api/releases/download/${CLUSTERCTL_VERSION}/cluster-template-development.yaml
- https://github.com/kubernetes-sigs/cluster-api/releases/download/${CAPI_VERSION}/cluster-template-development.yaml

sortOptions:
order: fifo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- https://github.com/kubernetes-sigs/cluster-api/releases/download/${CLUSTERCTL_VERSION}/clusterclass-quick-start.yaml
- https://github.com/kubernetes-sigs/cluster-api/releases/download/${CAPI_VERSION}/clusterclass-quick-start.yaml

configurations:
- kustomizeconfig.yaml
Expand Down
10 changes: 8 additions & 2 deletions make/clusterctl.mk
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# Copyright 2023 D2iQ, Inc. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

export CAPI_VERSION := $(shell go list -m -f '{{ .Version }}' sigs.k8s.io/cluster-api)
export CAPD_VERSION := $(shell go list -m -f '{{ .Version }}' sigs.k8s.io/cluster-api/test)
export CAPA_VERSION := $(shell cd hack/third-party/capa && go list -m -f '{{ .Version }}' sigs.k8s.io/cluster-api-provider-aws/v2)
export CAPX_VERSION := $(shell cd hack/third-party/capx && go list -m -f '{{ .Version }}' github.com/nutanix-cloud-native/cluster-api-provider-nutanix)
export CAAPH_VERSION := $(shell cd hack/third-party/caaph && go list -m -f '{{ .Version }}' sigs.k8s.io/cluster-api-addon-provider-helm)

# Leave Nutanix credentials empty here and set it when creating the clusters
.PHONY: clusterctl.init
Expand All @@ -15,8 +18,11 @@ clusterctl.init:
NUTANIX_ENDPOINT="" NUTANIX_PASSWORD="" NUTANIX_USER="" \
clusterctl init \
--kubeconfig=$(KIND_KUBECONFIG) \
--infrastructure docker,aws:${CAPA_VERSION},nutanix:${CAPX_VERSION} \
--addon helm \
--core cluster-api:$(CAPI_VERSION) \
--bootstrap kubeadm:$(CAPI_VERSION) \
--control-plane kubeadm:$(CAPI_VERSION) \
--infrastructure docker:$(CAPD_VERSION),aws:$(CAPA_VERSION),nutanix:$(CAPX_VERSION) \
--addon helm:$(CAAPH_VERSION) \
--wait-providers

.PHONY: clusterctl.delete
Expand Down
4 changes: 0 additions & 4 deletions make/examples.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

export KUBERNETES_VERSION := v1.27.5

export CLUSTERCTL_VERSION := $(shell clusterctl version -o short 2>/dev/null)
export CAPA_VERSION := $(shell cd hack/third-party/capa && go list -m -f '{{ .Version }}' sigs.k8s.io/cluster-api-provider-aws/v2)
export CAPX_VERSION := $(shell cd hack/third-party/capx && go list -m -f '{{ .Version }}' github.com/nutanix-cloud-native/cluster-api-provider-nutanix)

.PHONY: examples.sync
examples.sync: ## Syncs the examples by fetching upstream examples and applying kustomize patches
hack/examples/sync.sh
Loading