Support organizations/unknown#778
Conversation
| name, err := assetName(d, config, linkTmpl) | ||
| if err != nil { | ||
| return []Asset{}, err | ||
| name = fmt.Sprintf("//cloudresourcemanager.googleapis.com/projects/placeholder-%s", randString(8)) |
There was a problem hiding this comment.
Could this be handled in assetName instead of in this file? That would allow it to be centralized for all project-level resources
There was a problem hiding this comment.
In the long run, this might need to be fixed at a higher level - the project and billing info both get created from the same resource data, which means that they should technically have the same project ID. But in practice, it probably doesn't matter since they're separate asset types and (presumably) haven't been created yet.
For now - fixing this in assetName should be fine (and much simpler)
There was a problem hiding this comment.
I handled this in transport.go, after trying all kinds of getting project failed, it returns a placeholder-project string, while terraform data's project id is still an empty string. In ancestry manager, if terraform data project id is empty, then trigger the org/unknown handling.
There was a problem hiding this comment.
That probably would work - but unfortunately, we can't make that change in transport.go because it's shared with the Terraform provider. Could it happen in assetName instead?
There was a problem hiding this comment.
Added a workaround there to temporarily set the config's project, and unset it later, else need to copy the build template function over?
| name, err := assetName(d, config, linkTmpl) | ||
| if err != nil { | ||
| return []Asset{}, err | ||
| name = fmt.Sprintf("//cloudresourcemanager.googleapis.com/projects/placeholder-%s", randString(8)) |
There was a problem hiding this comment.
That probably would work - but unfortunately, we can't make that change in transport.go because it's shared with the Terraform provider. Could it happen in assetName instead?
|
/gcbrun - the test failures look unrelated and maybe flakey? |
DO_NOT_MERGE
This is just a draft, and requires magic modules change as well.