Skip to content

Commit

Permalink
Added optional routing field to regional hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
tarnfeld committed Nov 4, 2024
1 parent 86cd874 commit 18ca1b9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ func resourceCloudflareRegionalHostnameCreate(ctx context.Context, d *schema.Res
d.SetId(r.Hostname)
d.Set("hostname", r.Hostname)
d.Set("region_key", r.RegionKey)
if r.Routing != "" {

Check failure on line 47 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / test

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)

Check failure on line 47 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / golangci-lint

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)

Check failure on line 47 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / golangci-lint

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)

Check failure on line 47 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / tfproviderlint (ubuntu-latest)

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)

Check failure on line 47 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / tfproviderlint (ubuntu-latest)

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)
d.Set("routing", r.Routing)

Check failure on line 48 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / test

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)

Check failure on line 48 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / golangci-lint

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)

Check failure on line 48 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / golangci-lint

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)

Check failure on line 48 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / tfproviderlint (ubuntu-latest)

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)

Check failure on line 48 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / tfproviderlint (ubuntu-latest)

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)
}
d.Set("created_on", r.CreatedOn.Format(time.RFC3339Nano))
return nil
}
Expand All @@ -60,6 +63,9 @@ func resourceCloudflareRegionalHostnameRead(ctx context.Context, d *schema.Resou
d.SetId(r.Hostname)
d.Set("hostname", r.Hostname)
d.Set("region_key", r.RegionKey)
if r.Routing != "" {

Check failure on line 66 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / test

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)

Check failure on line 66 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / golangci-lint

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)

Check failure on line 66 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / tfproviderlint (ubuntu-latest)

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)

Check failure on line 66 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / tfproviderlint (ubuntu-latest)

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)
d.Set("routing", r.Routing)

Check failure on line 67 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / test

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)

Check failure on line 67 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / golangci-lint

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)

Check failure on line 67 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / tfproviderlint (ubuntu-latest)

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)

Check failure on line 67 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / tfproviderlint (ubuntu-latest)

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)
}
d.Set("created_on", r.CreatedOn.Format(time.RFC3339Nano))
return nil
}
Expand Down Expand Up @@ -88,6 +94,9 @@ func resourceCloudflareRegionalHostnameUpdate(ctx context.Context, d *schema.Res
d.SetId(r.Hostname)
d.Set("hostname", r.Hostname)
d.Set("region_key", r.RegionKey)
if r.Routing != "" {

Check failure on line 97 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / test

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)

Check failure on line 97 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / golangci-lint

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)

Check failure on line 97 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / tfproviderlint (ubuntu-latest)

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)
d.Set("routing", r.Routing)

Check failure on line 98 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / test

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)

Check failure on line 98 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / golangci-lint

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)) (typecheck)

Check failure on line 98 in internal/sdkv2provider/resource_cloudflare_regional_hostname.go

View workflow job for this annotation

GitHub Actions / tfproviderlint (ubuntu-latest)

r.Routing undefined (type cloudflare.RegionalHostname has no field or method Routing)
}
d.Set("created_on", r.CreatedOn.Format(time.RFC3339Nano))
return nil
}
Expand Down
5 changes: 5 additions & 0 deletions internal/sdkv2provider/schema_cloudflare_regional_hostname.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ func resourceCloudflareRegionalHostnameSchema() map[string]*schema.Schema {
Required: true,
Description: "The region key. See [the full region list](https://developers.cloudflare.com/data-localization/regional-services/get-started/).",
},
"routing": {
Type: schema.TypeString,
Required: false,
Description: "Configure which routing method to use for the regional hostname.",
},
"created_on": {
Type: schema.TypeString,
Computed: true,
Expand Down

0 comments on commit 18ca1b9

Please sign in to comment.