The deployment logic in r/r is a little complex for webhook.
Rancher has the rancher-webhook charts bundled in its image. Depending on timing and how well our git mirror is doing, Rancher might try to deploy the rancher-webhook chart embedded in the image, or it might deploy the chart pulled from the charts repo.
When it's pulling from the charts repo, then the webhook RC version in CATTLE_RANCHER_WEBHOOK_VERSION might be stale compared to the on in the charts repo. This leads to Rancher not being able to deploy webhook.
When using the bundled rancher-webhook chart, there's a very small chance that the bundled repo has a newer version of rancher-webhook than the one set in CATTLE_RANCHER_WEBHOOK_VERSION.
For the purpose of setting up Rancher for our tests, we really don't care what webhook version is installed because we'll be deploying the one from the PR anyway. So to eliminate these issues, we simply set CATTLE_RANCHER_WEBHOOK_VERSION to empty "". Rancher will then deploy the latest version of webhook it can find in the index chart, whether its from bundled or from git mirror.
Backport
Backport of https://github.com/rancher/webhook/pull/503
You can make changes to this PR with the following command:
Issue https://github.com/rancher/rancher/issues/47062
The deployment logic in r/r is a little complex for webhook.
Rancher has the rancher-webhook charts bundled in its image. Depending on timing and how well our git mirror is doing, Rancher might try to deploy the rancher-webhook chart embedded in the image, or it might deploy the chart pulled from the charts repo.
When it's pulling from the charts repo, then the webhook RC version in
CATTLE_RANCHER_WEBHOOK_VERSION
might be stale compared to the on in the charts repo. This leads to Rancher not being able to deploy webhook.When using the bundled rancher-webhook chart, there's a very small chance that the bundled repo has a newer version of rancher-webhook than the one set in
CATTLE_RANCHER_WEBHOOK_VERSION
.For the purpose of setting up Rancher for our tests, we really don't care what webhook version is installed because we'll be deploying the one from the PR anyway. So to eliminate these issues, we simply set
CATTLE_RANCHER_WEBHOOK_VERSION
to empty""
. Rancher will then deploy the latest version of webhook it can find in the index chart, whether its from bundled or from git mirror.