-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Image error #13863
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
Image error #13863
Changes from all commits
f3d2962
443baef
0acc4ea
5be10e2
59f9274
b43fb40
2b5b82e
45fec1b
834f5e4
ee076c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,6 +86,10 @@ var UniverseDomainEnvVars = []string{ | |
| "GOOGLE_UNIVERSE_DOMAIN", | ||
| } | ||
|
|
||
| var ProjectPrefixEnvVars = []string{ | ||
| "GOOGLE_PROJECT_PREFIX", | ||
| } | ||
|
|
||
| // This is the billing account that will be charged for the infrastructure used during testing. For | ||
| // that reason, it is also the billing account used for creating new projects. | ||
| var BillingAccountEnvVars = []string{ | ||
|
|
@@ -146,6 +150,11 @@ func GetTestUniverseDomainFromEnv(t *testing.T) string { | |
| return transport_tpg.MultiEnvSearch(UniverseDomainEnvVars) | ||
| } | ||
|
|
||
| // Project Prefix of different universes | ||
| func GetProjectPrefixFromEnv() string { | ||
hao-nan-li marked this conversation as resolved.
Show resolved
Hide resolved
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In a followup PR could you change the env var to include "Universe" in the namespace? i.e.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do |
||
| return transport_tpg.MultiEnvSearch(ProjectPrefixEnvVars) | ||
| } | ||
|
|
||
| // AccTestPreCheck ensures at least one of the region env variables is set. | ||
| func GetTestRegionFromEnv() string { | ||
| return transport_tpg.MultiEnvSearch(RegionEnvVars) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,6 +106,9 @@ func ResolveImage(c *transport_tpg.Config, project, name, userAgent string) (str | |
| break | ||
| } | ||
| } | ||
| if c.UniverseDomain != "" && c.UniverseDomain != "googleapis.com" { | ||
| resolveImageLink = regexp.MustCompile(fmt.Sprintf("^https://compute.%s/compute/[a-z0-9]+/projects/(%s)/global/images/(%s)", c.UniverseDomain, verify.ProjectRegex, resolveImageImageRegex)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fix works but we should probably make it more clear. Out of band, could we move |
||
| } | ||
| switch { | ||
| case resolveImageLink.MatchString(name): // https://www.googleapis.com/compute/v1/projects/xyz/global/images/xyz | ||
| return name, nil | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.