Skip to content

Commit

Permalink
Refactor check_galaxy + fix version (#10729) (#10891)
Browse files Browse the repository at this point in the history
* Remove checks for docs using exact tags

Instead use a more generic documentation for installing kubespray as a
collection from git.

* Check that we upgraded galaxy.yml to next version

This is only intented to check for human error. The version in galaxy
should be the next (which does not mean the same if we're on master or a
release branch).

* Set collection version to KUBESPRAY_NEXT_VERSION
  • Loading branch information
VannTen committed Feb 6, 2024
1 parent 1f4ca14 commit 12a65c4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ You will then need to use [bind mounts](https://docs.docker.com/storage/bind-mou
to access the inventory and SSH key in the container, like this:

```ShellSession
git checkout v2.22.0
docker pull quay.io/kubespray/kubespray:v2.22.0
git checkout v2.22.2
docker pull quay.io/kubespray/kubespray:v2.22.2
docker run --rm -it --mount type=bind,source="$(pwd)"/inventory/sample,dst=/inventory \
--mount type=bind,source="${HOME}"/.ssh/id_rsa,dst=/root/.ssh/id_rsa \
quay.io/kubespray/kubespray:v2.22.0 bash
Expand Down
2 changes: 1 addition & 1 deletion docs/ansible_collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Kubespray can be installed as an [Ansible collection](https://docs.ansible.com/a
collections:
- name: https://github.com/kubernetes-sigs/kubespray
type: git
version: v2.21.0
version: v2.22.2
```

2. Install your collection
Expand Down
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
namespace: kubernetes_sigs
description: Deploy a production ready Kubernetes cluster
name: kubespray
version: 2.21.0
version: 2.22.2
readme: README.md
authors:
- luksi1
Expand Down
14 changes: 4 additions & 10 deletions tests/scripts/check_galaxy_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@
set -e

version_from_galaxy=$(grep "^version:" galaxy.yml | awk '{print $2}')
version_from_docs=$(grep -P "^\s+version:\sv\d+\.\d+\.\d+" docs/ansible_collection.md | awk '{print $2}')

if [[ $KUBESPRAY_VERSION != "v${version_from_galaxy}" ]]
# TODO: compute the next expected version somehow
if [[ $KUBESPRAY_VERSION == "v${version_from_galaxy}" ]]
then
echo "Please update galaxy.yml version to match the KUBESPRAY_VERSION. Be sure to remove the \"v\" to adhere"
echo "to semenatic versioning"
exit 1
fi

if [[ $KUBESPRAY_VERSION != "${version_from_docs}" ]]
then
echo "Please update the documentation for Ansible collections under docs/ansible_collection.md to reflect the KUBESPRAY_VERSION"
echo "Please update galaxy.yml version to match the next KUBESPRAY_VERSION."
echo "Be sure to remove the \"v\" to adhere to semantic versioning"
exit 1
fi

0 comments on commit 12a65c4

Please sign in to comment.