Orb version
3.1.1
What happened
We've been using this orb, with the CLI version set to latest
and the executor set to gcp-cli/google
. However, this leads to an issue every few weeks where either:
- Google has updated the Docker image with a new GCP CLI version, but hasn't updated their changelog page
- Google has updated their changelog page with a new GCP CLI version, but hasn't released an updated Docker image
When that happens, our deploys are blocked with an error along these lines:
The version installed (451.0.0) differs from the version requested (451.0.1).
Uninstalling v451.0.0...
sudo is required to uninstall the Google Cloud SDK.
Please install it and try again.
Failed to uninstall the current version.
Exited with code exit status 1
There's no way to get past this, unless we hard-set the CLI version to whatever's in the Docker image. This is frequently leading to our deploys being blocked for hours, sometimes up to a day.
In our case, we'd be more than happy to simply use whatever version is provided by the latest Google Cloud SDK docker image. We know it'll be the newest version the vast majority of the time, and if it's not the newest version, it'll be very, very close. And the docs for this orb's install
command suggest that this is the intended behaviour (emphasis mine):
Install the gcloud CLI. **When installing within the Docker executor, the
install will only occur if the CLI isn't already installed.** If installing in
a Linux machine image, it will remove the pre-installed version and instead
install the version specified by this orb.
Expected behavior
When using the gcp-cli/google
executor and the latest
version is specified for the CLI, don't try to uninstall/reinstall a different version, because doing so will always fail with permission errors anyway.
(I'd be happy enough to put together a PR for this, but I wanted to open the discussion first to make sure I wouldn't be wasting any work putting forward a fix for this)