Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orb tries to install the latest CLI version, even though it's already in the image #80

Open
simon360 opened this issue Oct 20, 2023 · 1 comment

Comments

@simon360
Copy link

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)

@awinograd
Copy link

Just experienced this same issue for the first time. Another potential solution would be to expose a new command gcp-cli/setup-no-install / gcp-cli/setup-only which executes the setup step without attempting to perform an install. Instead, it assumes that gcloud is already properly installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants