cli: support for GCP marketplace images (#2792)

* cli: support GCP marketplace images

* ci: support GCP marketplace images

* docs: support GCP marketplace images

* bazel: generate

* ci: allow GCP for mpi e2e test

* Update docs/docs/overview/license.md

Co-authored-by: Thomas Tendyck <51411342+thomasten@users.noreply.github.com>

* terraform-provider: allow GCP MPIs

* terraform-provider: fix error message

---------

Co-authored-by: Thomas Tendyck <51411342+thomasten@users.noreply.github.com>
This commit is contained in:
Moritz Sanft 2024-01-08 15:51:39 +01:00 committed by GitHub
parent d3b951300d
commit e691e26bd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 77 additions and 21 deletions

View file

@ -87,8 +87,8 @@ func (d *ImageDataSource) Schema(_ context.Context, _ datasource.SchemaRequest,
},
"csp": newCSPAttributeSchema(),
"marketplace_image": schema.BoolAttribute{
Description: "Whether a marketplace image should be used. Currently only supported for Azure.",
MarkdownDescription: "Whether a marketplace image should be used. Currently only supported for Azure.",
Description: "Whether a marketplace image should be used. Currently only supported for Azure and GCP.",
MarkdownDescription: "Whether a marketplace image should be used. Currently only supported for Azure and GCP.",
Optional: true,
},
"region": schema.StringAttribute{
@ -128,11 +128,11 @@ func (d *ImageDataSource) ValidateConfig(ctx context.Context, req datasource.Val
)
}
// Marketplace image is only supported for Azure
if !data.CSP.Equal(types.StringValue("azure")) && !data.MarketplaceImage.IsNull() {
resp.Diagnostics.AddAttributeWarning(
// Marketplace image is only supported for Azure and GCP
if data.CSP.Equal(types.StringValue("aws")) && !data.MarketplaceImage.IsNull() {
resp.Diagnostics.AddAttributeError(
path.Root("marketplace_image"),
"Marketplace images are currently only supported on Azure", "When another CSP than Azure is used, setting 'marketplace_image' has no effect.",
"Marketplace images are currently only supported on Azure and GCP", "When another CSP than Azure or GCP is used, marketplace images are unavailable.",
)
}