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

Fails to install components if gcloud came from apt #69

Closed
mgabeler-lee-6rs opened this issue Feb 22, 2023 · 3 comments
Closed

Fails to install components if gcloud came from apt #69

mgabeler-lee-6rs opened this issue Feb 22, 2023 · 3 comments
Assignees

Comments

@mgabeler-lee-6rs
Copy link

Orb version

3.0.1

What happened

We embed steps from this orb in an orb of our own, and so sometimes we end up calling it in a workflow that is running from an image that has at least the base gcloud already installed, such as gcr.io/google.com/cloudsdktool/cloud-sdk, since our orb steps that need gcloud sometimes run in containers without gcloud pre-installed, and sometimes in ones that have it installed.

This orb detects that gcloud is already installed, but then when trying to install the requested components, it always uses gcloud components install ..., which is not allowed when gcloud was installed via apt (or some other package manager). This causes the install step to fail with an error like this:

ERROR: (gcloud.components.install) 
You cannot perform this action because the Google Cloud CLI component manager 
is disabled for this installation. You can run the following command 
to achieve the same result for this installation: 

sudo apt-get install google-cloud-sdk-gke-gcloud-auth-plugin

Expected behavior

It should install the requested components via apt-get when necessary.

Additional Notes

Google is in the process of trying to transition the name of the "sdk" package to "cli", and the names of the component packages needs to match the main gcloud package, so e.g. if google-cloud-cli is installed, component packages need to be installed as google-cloud-cli-<component>, trying to install google-cloud-sdk-<component> will fail, and vice versa. It doesn't help matters that the error message from gcloud components install always tells you to use the sdk variant even when that's wrong.

@david-montano-circleci david-montano-circleci self-assigned this Nov 6, 2024
@david-montano-circleci
Copy link
Contributor

Hello @mgabeler-lee-6rs , thank you for reporting this.
I understand the issue you describe but it seems to be completely tied to apt. The approach this orb takes for Linux distributions is to install the binary without any package manager to make it as flexible as possible.
Would it be possible in your use case to use a docker image that does not have gcloud installed and use the installation logic form this orb to configure it?

@mgabeler-lee-6rs
Copy link
Author

  1. It's been more than 18 months, so our environments have moved forwards and I don't remember for sure right now which one(s) were affected by this. Obviously we found workarounds.
  2. As you can see from the original ticket, in at least some cases we are using third party containers. If you think that the default gcloud container published by Google should be built differently, you'll have to take that up with Google 🙃
  3. I don't think it should be too hard for this orb to check how gcloud is installed and conditionally use the apt command to install components if that is required 🤷‍♂️

@david-montano-circleci
Copy link
Contributor

It is not too hard but it would make this orb support apt and maybe other package managers in the future.
If gcloud was installed via apt or comes installed already in the executor, then executing run steps to install components via apt should work.

This orb only supports installation of components for gcloud binaries that where installed using this same orb.

Thank you again for opening this issue and sorry that it took 18 months to answer. We are pushing forward to evolve orbs for our users.

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