Skip to content

Commit b43fb40

Browse files
committed
Fix check destroyer error in different universe domain
1 parent 59f9274 commit b43fb40

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

mmv1/third_party/terraform/provider/provider.go.tmpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,13 @@ func ProviderConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
416416
return nil, diag.FromErr(err)
417417
}
418418

419+
// Bypass checkDestroyer failure with universe domain set
420+
if _, ok := d.GetOk("universe_domain"); !ok {
421+
if config.UniverseDomain != "" && config.UniverseDomain != "googleapis.com" {
422+
d.Set("universe_domain", config.UniverseDomain)
423+
}
424+
}
425+
419426
// Verify that universe domains match between credentials and configuration
420427
if v, ok := d.GetOk("universe_domain"); ok {
421428
if config.UniverseDomain == "" && v.(string) != "googleapis.com" { // v can't be "", as it wouldn't pass `ok` above

mmv1/third_party/terraform/provider/universe/universe_domain_compute_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ func TestAccUniverseDomainDisk(t *testing.T) {
3434
}
3535

3636
func TestAccUniverseDomainDiskImage(t *testing.T) {
37-
// Skip this test in all env since this can only run in specific test project.
38-
// t.Skip()
3937

4038
universeDomain := envvar.GetTestUniverseDomainFromEnv(t)
4139
zone := envvar.GetTestZoneFromEnv()

0 commit comments

Comments
 (0)