Ensure GKE nodes are on a recent rather than just a valid version (#337)

Before, the test checked if the node version is in validNodeVersions. However, unlike the short validMasterVersions the list in validNodeVersions is very long and goes all the way back to k8s 1.6. Thus, this did not actually test that the node version was up-to-date.

I initially thought to just check that the node version matched the master version, but realized this is not a good idea since google doesn't upgrade clusters and nodes in lockstep.

Instead, I've changed the check to verify that the node version is in the list of valid master versions. That should ensure we're on a recent version and still pass in the gap between cluster and node upgrades.
This commit is contained in:
Brian Pitts 2020-09-16 09:52:52 -04:00 коммит произвёл GitHub
Родитель 9f14ba1dc3
Коммит 1ac2b76520
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -27,7 +27,7 @@ def test_gke_version_up_to_date(cluster, server_config):
cluster["currentMasterVersion"]
)
assert (
cluster["currentNodeVersion"] in server_config["validNodeVersions"]
), "Current GKE node version ({}) is not in the list of valid node versions.".format(
cluster["currentNodeVersion"] in server_config["validMasterVersions"]
), "Current GKE node version ({}) is not in the list of valid master versions.".format(
cluster["currentNodeVersion"]
)