terraform: fix Azure marketplace image defaults (#2692)

* config: default to false instead of null for Azure marketplace image

Signed-off-by: Moritz Sanft <58110325+msanft@users.noreply.github.com>

* terraform: make Azure marketplace image default to null

Signed-off-by: Moritz Sanft <58110325+msanft@users.noreply.github.com>

---------

Signed-off-by: Moritz Sanft <58110325+msanft@users.noreply.github.com>
This commit is contained in:
Moritz Sanft 2023-12-11 08:15:47 +01:00 committed by GitHub
parent acba9c4c60
commit 6ff321364d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 3 deletions

View File

@ -156,6 +156,7 @@ func azureTerraformVars(conf *config.Config, imageRef string) (*terraform.AzureC
ResourceGroup: conf.Provider.Azure.ResourceGroup,
CustomEndpoint: conf.CustomEndpoint,
InternalLoadBalancer: conf.InternalLoadBalancer,
MarketplaceImage: nil,
}
if conf.UseMarketplaceImage() {
@ -170,7 +171,7 @@ func azureTerraformVars(conf *config.Config, imageRef string) (*terraform.AzureC
}
// If a marketplace image is used, only the marketplace reference is required.
vars.MarketplaceImage = terraform.AzureMarketplaceImageVariables{
vars.MarketplaceImage = &terraform.AzureMarketplaceImageVariables{
Publisher: azureImage.Publisher,
Product: azureImage.Offer,
Name: azureImage.SKU,

View File

@ -210,7 +210,7 @@ type AzureClusterVariables struct {
// InternalLoadBalancer is true if an internal load balancer should be created.
InternalLoadBalancer bool `hcl:"internal_load_balancer" cty:"internal_load_balancer"`
// MarketplaceImage is the (optional) Azure Marketplace image to use.
MarketplaceImage AzureMarketplaceImageVariables `hcl:"marketplace_image" cty:"marketplace_image"`
MarketplaceImage *AzureMarketplaceImageVariables `hcl:"marketplace_image" cty:"marketplace_image"`
}
// GetCreateMAA gets the CreateMAA variable.

View File

@ -193,7 +193,7 @@ func TestAzureClusterVariables(t *testing.T) {
Debug: to.Ptr(true),
Location: "eu-central-1",
CustomEndpoint: "example.com",
MarketplaceImage: AzureMarketplaceImageVariables{
MarketplaceImage: &AzureMarketplaceImageVariables{
Publisher: "edgelesssys",
Product: "constellation",
Name: "constellation",

View File

@ -341,6 +341,7 @@ func Default() *Config {
ResourceGroup: "",
DeployCSIDriver: toPtr(true),
SecureBoot: toPtr(false),
UseMarketplaceImage: toPtr(false),
},
GCP: &GCPConfig{
Project: "",