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

Spurious warning auth is unavailabe, but gcloud works #670

Closed
joshgc opened this issue Dec 21, 2023 · 3 comments · Fixed by #671
Closed

Spurious warning auth is unavailabe, but gcloud works #670

joshgc opened this issue Dec 21, 2023 · 3 comments · Fixed by #671
Labels
enhancement New feature or request

Comments

@joshgc
Copy link

joshgc commented Dec 21, 2023

TL;DR

We run out GHA on self-hosted runners on GKE. When using v1 like...

Run google-github-actions/setup-gcloud@v1
  with:
    skip_install: false
    version: latest

we get the following warning

Warning: No authentication found for gcloud, authenticate with `google-github-actions/auth`.

However gcloud works fine.

Detailed design

Looking at the code here, I expect the issue is that no credentials file is present but gcloud is able to find the GCE Metadata server. This seems like a safe path so I'm wondering if we could drop the warning?

Additional information

No response

@joshgc joshgc added the enhancement New feature or request label Dec 21, 2023
@sethvargo
Copy link
Member

Hi @joshgc - we can definitely change the warning, but we added it because many users were submitting issues when the authentication was missing (often due to skipping actions/checkout or resetting the workspace between steps).

Warnings are just that – warnings. If you know what you're doing and things are working, you can ignore it.

Additionally, I'm not sure what value setup-gcloud is providing in your case. If you're using ADC from the default metadata server on self-hosted runners, you may be better bundling gcloud into your base image and skipping the download; gcloud is quite large and if you've already taken the plunge to use self-hosted runners, you'd see a major performance benefit from skipping this step entirely.

@joshgc
Copy link
Author

joshgc commented Dec 21, 2023

Thanks @sethvargo agreed its just a warning and so this is not a p0 feature request. So right now we are using the default actions-runner-controller image and not a layer built-ontop of it, which is why we still install gcloud with this action. Then we pull and run a dynamic much more sophisticated image with all of our dependencies that may change from commit-to-commit (eg. python deps in requirements.txt).

How would you feel about checking this method isAuthenticated and then if its false we check and warn on the creds file?
https://github.com/google-github-actions/setup-cloud-sdk/blob/main/src/index.ts#L157

sethvargo added a commit that referenced this issue Dec 21, 2023
This fixes an issue where a warning message would be printed on systems
using ADC from the metadata server.

Fixes #670
@joshgc
Copy link
Author

joshgc commented Dec 21, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging a pull request may close this issue.

2 participants