Test the correct version when testing collection + upgrade (#12675)

If we don't rebuild the collection and remove the previous archive we'll
test the first built.
This commit is contained in:
Max Gautier
2025-11-12 02:56:56 +00:00
committed by GitHub
parent 97a3776d8e
commit 61b8e4ce84

View File

@@ -24,17 +24,13 @@ fi
export ANSIBLE_BECOME=true
export ANSIBLE_BECOME_USER=root
# Test collection build and install by installing our collection, emptying our repository, adding
# cluster.yml, reset.yml, and remote-node.yml files that simply point to our collection's playbooks, and then
# running the same tests as before
if [[ "${TESTCASE}" =~ "collection" ]]; then
# Build and install collection
ansible-galaxy collection build
ansible-galaxy collection install kubernetes_sigs-kubespray-*.tar.gz
fi
run_playbook () {
if [[ "${TESTCASE}" =~ "collection" ]]; then
playbook=kubernetes_sigs.kubespray.$1
# Handle upgrade case properly
rm -f kubernetes_sigs-kubespray-*.tar.gz
ansible-galaxy collection build
ansible-galaxy collection install kubernetes_sigs-kubespray-*.tar.gz
else
playbook=$1.yml
fi