Skip to content

Check that CAPI versions are aligned #1705

@guettli

Description

@guettli

/kind feature

I notice that the capi version is used at several places, but not in sync.

We should add a check that ensures these version align.

Examples:

❯ git ls-files | grep -v vendor | xargs grep 1.10.4
go.mod: sigs.k8s.io/cluster-api v1.10.4
go.mod: sigs.k8s.io/cluster-api/test v1.10.4
...
❯ grep CLUSTERCTL_VERSION Makefile 
CLUSTERCTL_VERSION ?= v1.8.10
...

Here it is not that important:

❯ git ls-files | grep -v vendor | xargs grep 1.8.4
docs/caph/02-topics/04-upgrading-caph.md:bootstrap-kubeadm        capi-kubeadm-bootstrap-system       BootstrapProvider        v1.8.0            v1.8.4
docs/caph/02-topics/04-upgrading-caph.md:control-plane-kubeadm    capi-kubeadm-control-plane-system   ControlPlaneProvider     v1.8.0            v1.8.4
docs/caph/02-topics/04-upgrading-caph.md:cluster-api              capi-system                         CoreProvider             v1.8.0            v1.8.4
docs/caph/02-topics/04-upgrading-caph.md:We will upgrade cluster API core components to v1.8.4 version.
docs/caph/02-topics/04-upgrading-caph.md:Installing Provider="cluster-api" Version="v1.8.4" TargetNamespace="capi-system"
docs/caph/02-topics/04-upgrading-caph.md:Installing Provider="bootstrap-kubeadm" Version="v1.8.4" TargetNamespace="capi-kubeadm-bootstrap-system"
docs/caph/02-topics/04-upgrading-caph.md:Installing Provider="control-plane-kubeadm" Version="v1.8.4" TargetNamespace="capi-kubeadm-control-plane-system"
❯ git ls-files | grep -v vendor | xargs grep 1.8.10
Makefile:CLUSTERCTL_VERSION ?= v1.8.10

Tiltfile:    "capi_version": "v1.8.10",

docs/caph/02-topics/05-baremetal/02-management-cluster.md:Installing Provider="cluster-api" Version="v1.8.10" TargetNamespace="capi-system"
docs/caph/02-topics/05-baremetal/02-management-cluster.md:Installing Provider="bootstrap-kubeadm" Version="v1.8.10" TargetNamespace="capi-kubeadm-bootstrap-system"
docs/caph/02-topics/05-baremetal/02-management-cluster.md:Installing Provider="control-plane-kubeadm" Version="v1.8.10" TargetNamespace="capi-kubeadm-control-plane-system"
docs/caph/04-developers/02-tilt.md:"capi_version": "v1.8.10",
docs/caph/04-developers/02-tilt.md:| `capi_version`            | `string`   | `"v1.8.10"`      | no       | Version of CAPI                                                                                                                                                                                                       |

test/e2e/config/hetzner.yaml:      - name: v1.8.10
test/e2e/config/hetzner.yaml:        value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.8.10/core-components.yaml"
test/e2e/config/hetzner.yaml:      - name: v1.8.10
test/e2e/config/hetzner.yaml:        value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.8.10/bootstrap-components.yaml"
test/e2e/config/hetzner.yaml:      - name: v1.8.10
test/e2e/config/hetzner.yaml:        value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.8.10/control-plane-components.yaml"
test/e2e/config/hetzner.yaml:  INIT_WITH_BINARY: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.8.10/clusterctl-linux-amd64"

Describe the solution you'd like

I want the version numbers to be equal. Example output in Markdown files can be out-of-sync.

We could do that by writing a small Bash script which reads the wanted version from go.mod. Example: sigs.k8s.io/cluster-api v1.10.4 defines the desire version. All other places should use that.

A script which detects the "out-of-sync" is enough. No automation to keep that in sync is needed for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions