Skip to content

Commit 4442adf

Browse files
committed
add local image type validation
1 parent 6a4fbd2 commit 4442adf

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

internal/services/marketplace/image_data_source.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/scaleway/scaleway-sdk-go/scw"
1010
"github.com/scaleway/terraform-provider-scaleway/v2/internal/datasource"
1111
"github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/zonal"
12+
"github.com/scaleway/terraform-provider-scaleway/v2/internal/verify"
1213
)
1314

1415
func DataSourceImage() *schema.Resource {
@@ -27,10 +28,11 @@ func DataSourceImage() *schema.Resource {
2728
Description: "The instance commercial type of the desired image",
2829
},
2930
"image_type": {
30-
Type: schema.TypeString,
31-
Optional: true,
32-
Default: "instance_local", // Keep the old default as default to avoid a breaking change.
33-
Description: "The type of the desired image, instance_local or instance_sbs",
31+
Type: schema.TypeString,
32+
Optional: true,
33+
Default: "instance_local", // Keep the old default as default to avoid a breaking change.
34+
Description: "The type of the desired image, instance_local or instance_sbs",
35+
ValidateDiagFunc: verify.ValidateEnum[marketplace.LocalImageType](),
3436
},
3537
"zone": zonal.Schema(),
3638
},

0 commit comments

Comments
 (0)