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

Commit bf3a644

Browse files
authored
build: Specify CAPI provider versions from go module versions (#47)
This makes the deployment consistent as well as avoiding issues when providers are in the middle of a release.
1 parent a137bb5 commit bf3a644

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

hack/examples/bases/docker/cluster/kustomization.yaml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
55
kind: Kustomization
66

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

1010
sortOptions:
1111
order: fifo

hack/examples/bases/docker/clusterclass/kustomization.yaml.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
55
kind: Kustomization
66

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

1010
configurations:
1111
- kustomizeconfig.yaml

make/clusterctl.mk

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# Copyright 2023 D2iQ, Inc. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0
33

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

710
# Leave Nutanix credentials empty here and set it when creating the clusters
811
.PHONY: clusterctl.init
@@ -15,8 +18,11 @@ clusterctl.init:
1518
NUTANIX_ENDPOINT="" NUTANIX_PASSWORD="" NUTANIX_USER="" \
1619
clusterctl init \
1720
--kubeconfig=$(KIND_KUBECONFIG) \
18-
--infrastructure docker,aws:${CAPA_VERSION},nutanix:${CAPX_VERSION} \
19-
--addon helm \
21+
--core cluster-api:$(CAPI_VERSION) \
22+
--bootstrap kubeadm:$(CAPI_VERSION) \
23+
--control-plane kubeadm:$(CAPI_VERSION) \
24+
--infrastructure docker:$(CAPD_VERSION),aws:$(CAPA_VERSION),nutanix:$(CAPX_VERSION) \
25+
--addon helm:$(CAAPH_VERSION) \
2026
--wait-providers
2127

2228
.PHONY: clusterctl.delete

make/examples.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33

44
export KUBERNETES_VERSION := v1.27.5
55

6-
export CLUSTERCTL_VERSION := $(shell clusterctl version -o short 2>/dev/null)
7-
export CAPA_VERSION := $(shell cd hack/third-party/capa && go list -m -f '{{ .Version }}' sigs.k8s.io/cluster-api-provider-aws/v2)
8-
export CAPX_VERSION := $(shell cd hack/third-party/capx && go list -m -f '{{ .Version }}' github.com/nutanix-cloud-native/cluster-api-provider-nutanix)
9-
106
.PHONY: examples.sync
117
examples.sync: ## Syncs the examples by fetching upstream examples and applying kustomize patches
128
hack/examples/sync.sh

0 commit comments

Comments
 (0)