Skip to content

Commit f9fb0e3

Browse files
update origin field to use self link or name (#5243) (#3673)
* update origin field to use self link or name * suppress diff on failover origin for self link vs resource name * just compare the resource names Signed-off-by: Modular Magician <[email protected]>
1 parent 1b8cc04 commit f9fb0e3

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

.changelog/5243.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

google-beta/resource_dataproc_cluster_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ import (
1313
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
1414
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
1515

16-
"google.golang.org/api/googleapi"
17-
1816
dataproc "google.golang.org/api/dataproc/v1beta2"
17+
"google.golang.org/api/googleapi"
1918
)
2019

2120
func TestDataprocExtractInitTimeout(t *testing.T) {

google-beta/resource_gke_hub_feature_membership_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"testing"
77

8-
dcl "github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
8+
"github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl"
99
gkehub "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/gkehub/beta"
1010
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
1111
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"

google-beta/resource_network_services_edge_cache_origin.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,9 @@ If a Cloud Storage bucket is provided, it must be in the canonical "gs://bucketn
6868
Description: `A human-readable description of the resource.`,
6969
},
7070
"failover_origin": {
71-
Type: schema.TypeString,
72-
Optional: true,
71+
Type: schema.TypeString,
72+
Optional: true,
73+
DiffSuppressFunc: compareResourceNames,
7374
Description: `The Origin resource to try when the current origin cannot be reached.
7475
After maxAttempts is reached, the configured failoverOrigin will be used to fulfil the request.
7576

google-beta/resource_network_services_edge_cache_service.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,8 +341,9 @@ Response headers are only sent to the client, and do not have an effect on the c
341341
},
342342
},
343343
"origin": {
344-
Type: schema.TypeString,
345-
Optional: true,
344+
Type: schema.TypeString,
345+
Optional: true,
346+
DiffSuppressFunc: compareSelfLinkOrResourceName,
346347
Description: `The Origin resource that requests to this route should fetch from when a matching response is not in cache. Origins can be defined as short names ("my-origin") or fully-qualified resource URLs - e.g. "networkservices.googleapis.com/projects/my-project/global/edgecacheorigins/my-origin"
347348
348349
Only one of origin or urlRedirect can be set.`,

0 commit comments

Comments
 (0)