Skip to content

Commit

Permalink
🐛Only request project-id from gcloud cli if its not in the options. (#…
Browse files Browse the repository at this point in the history
…862)

Only call the gcloud cli if both `project` and `project-id` are empty.
  • Loading branch information
preslavgerchev authored Jan 31, 2023
1 parent b73c8f6 commit 57014f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion motor/discovery/gcp/resolver_gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (r *GcpResolver) Resolve(ctx context.Context, root *asset.Asset, tc *provid
// when the user has not provided a project, check if we got a project or try to determine it
// FIXME: DEPRECATED, update in v8.0 vv
// The option "project" has been deprecated in favor of project-id
if tc.Options == nil || (tc.Options["project"] == "" || tc.Options["project-id"] != "") {
if tc.Options == nil || (tc.Options["project"] == "" && tc.Options["project-id"] == "") {
// ^^
// try to determine current project
projectid, err := gcp_provider.GetCurrentProject()
Expand Down

0 comments on commit 57014f1

Please sign in to comment.