Skip to content
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

Replace ReadContext with ReadWithoutTimeout #389

Merged
merged 4 commits into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/provider/data_source_aws_network_peering.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

func dataSourceAwsNetworkPeering() *schema.Resource {
return &schema.Resource{
Description: "The AWS network peering data source provides information about an existing network peering between an HVN and a peer AWS VPC.",
ReadContext: dataSourceAwsNetworkPeeringRead,
Description: "The AWS network peering data source provides information about an existing network peering between an HVN and a peer AWS VPC.",
ReadWithoutTimeout: dataSourceAwsNetworkPeeringRead,
Timeouts: &schema.ResourceTimeout{
Read: &peeringCreateTimeout,
},
Expand Down Expand Up @@ -114,7 +114,7 @@ func dataSourceAwsNetworkPeeringRead(ctx context.Context, d *schema.ResourceData
}

if waitForActive && peering.State != networkmodels.HashicorpCloudNetwork20200907PeeringStateACTIVE {
peering, err = clients.WaitForPeeringToBeActive(ctx, client, peering.ID, hvnID, loc, d.Timeout(schema.TimeoutRead))
peering, err = clients.WaitForPeeringToBeActive(ctx, client, peering.ID, hvnID, loc, peeringCreateTimeout)
if err != nil {
return diag.FromErr(err)
}
Expand Down
6 changes: 3 additions & 3 deletions internal/provider/data_source_azure_peering_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (

func dataSourceAzurePeeringConnection() *schema.Resource {
return &schema.Resource{
Description: "The Azure peering connection data source provides information about a peering connection between an HVN and a peer Azure VNet.",
ReadContext: dataSourceAzurePeeringConnectionRead,
Description: "The Azure peering connection data source provides information about a peering connection between an HVN and a peer Azure VNet.",
ReadWithoutTimeout: dataSourceAzurePeeringConnectionRead,
Timeouts: &schema.ResourceTimeout{
Read: &peeringCreateTimeout,
},
Expand Down Expand Up @@ -129,7 +129,7 @@ func dataSourceAzurePeeringConnectionRead(ctx context.Context, d *schema.Resourc
}

if waitForActive && peering.State != networkmodels.HashicorpCloudNetwork20200907PeeringStateACTIVE {
peering, err = clients.WaitForPeeringToBeActive(ctx, client, peering.ID, hvnLink.ID, loc, d.Timeout(schema.TimeoutRead))
peering, err = clients.WaitForPeeringToBeActive(ctx, client, peering.ID, hvnLink.ID, loc, peeringCreateTimeout)
if err != nil {
return diag.FromErr(err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ func TestAccAzurePeeringConnection(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "peer_tenant_id", tenantID),
resource.TestCheckResourceAttr(resourceName, "peer_vnet_name", uniqueAzurePeeringTestID),
resource.TestCheckResourceAttrSet(resourceName, "peer_vnet_region"),
resource.TestCheckResourceAttrSet(resourceName, "azure_peering_id"),
resource.TestCheckResourceAttrSet(resourceName, "organization_id"),
resource.TestCheckResourceAttrSet(resourceName, "project_id"),
resource.TestCheckResourceAttrSet(resourceName, "created_at"),
resource.TestCheckResourceAttrSet(resourceName, "expires_at"),
resource.TestCheckResourceAttrSet(resourceName, "state"),
testLink(resourceName, "self_link", uniqueAzurePeeringTestID, PeeringResourceType, "hcp_hvn.test"),
// Note: azure_peering_id is not set until the peering is accepted after creation.
),
},
// Tests import
Expand Down