gcloud login tidy

Use unless instead of if !, don't suggest running gcloud auth login,
we've just tried that.
This commit is contained in:
Donal McBreen
2025-01-17 12:34:38 +00:00
parent 10dafc058a
commit f9a78f4fcb

View File

@@ -18,9 +18,9 @@ class Kamal::Secrets::Adapters::GcpSecretManager < Kamal::Secrets::Adapters::Bas
# - "default|my-service-user@example.com" will use the default user, and enable service account impersonation as my-service-user
# - "default|my-service-user@example.com,another-service-user@example.com" same as above, but with an impersonation delegation chain
if !logged_in?
unless logged_in?
`gcloud auth login`
raise RuntimeError, "gcloud is not authenticated, please run `gcloud auth login`" if !logged_in?
raise RuntimeError, "could not login to gcloud" unless logged_in?
end
nil