From 512f5632df5fc0285783424c63bbd6f1b9539a3e Mon Sep 17 00:00:00 2001 From: Max Gautier Date: Thu, 11 Jan 2024 15:49:31 +0100 Subject: [PATCH] Refactor check_galaxy + fix version (#10729) * 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 --- docs/ansible_collection.md | 2 +- tests/scripts/check_galaxy_version.sh | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/docs/ansible_collection.md b/docs/ansible_collection.md index 71ffb54f3d7..bcf23baa391 100644 --- a/docs/ansible_collection.md +++ b/docs/ansible_collection.md @@ -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.22.1 + version: master # use the appropriate tag or branch for the version you need ``` 2. Install your collection diff --git a/tests/scripts/check_galaxy_version.sh b/tests/scripts/check_galaxy_version.sh index b6679dba472..d663f121f07 100755 --- a/tests/scripts/check_galaxy_version.sh +++ b/tests/scripts/check_galaxy_version.sh @@ -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