Skip to content

Commit 285a74b

Browse files
committed
remove dev.tfrc
1 parent f695db0 commit 285a74b

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

internal/services/block/volume.go

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,16 +171,21 @@ func ResourceBlockVolumeRead(ctx context.Context, d *schema.ResourceData, m any)
171171
_ = d.Set("zone", volume.Zone)
172172
_ = d.Set("project_id", volume.ProjectID)
173173
_ = d.Set("tags", volume.Tags)
174-
_, err = api.GetSnapshot(&block.GetSnapshotRequest{
175-
SnapshotID: *volume.ParentSnapshotID,
176-
Zone: zone,
177-
})
178-
if volume.ParentSnapshotID != nil && !httperrors.Is403(err) && !httperrors.Is404(err) {
179-
_ = d.Set("snapshot_id", zonal.NewIDString(zone, *volume.ParentSnapshotID))
180-
} else {
181-
_ = d.Set("snapshot_id", "")
174+
snapshotID := ""
175+
if volume.ParentSnapshotID != nil {
176+
id := *volume.ParentSnapshotID
177+
_, err := api.GetSnapshot(&block.GetSnapshotRequest{
178+
SnapshotID: id,
179+
Zone: zone,
180+
})
181+
182+
if !httperrors.Is403(err) && !httperrors.Is404(err) {
183+
snapshotID = zonal.NewIDString(zone, id)
184+
}
182185
}
183186

187+
_ = d.Set("snapshot_id", snapshotID)
188+
184189
return nil
185190
}
186191

tests/dev.tfrc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
provider_installation {
2+
dev_overrides {
3+
"scaleway/scaleway" = "/Users/lmasson/go/bin"
4+
}
5+
6+
# For all other providers, install them directly from their origin provider
7+
# registries as normal. If you omit this, Terraform will _only_ use
8+
# the dev_overrides block, and so no other providers will be available.
9+
direct {}
10+
}
11+
12+

0 commit comments

Comments
 (0)