mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-10-01 01:36:09 -04:00
cli: fix upgrade by passing placeholder values for images (#2250)
Co-authored-by: Leonard Cohnen <lc@edgeless.systems>
This commit is contained in:
parent
587ae6a575
commit
ca47d26634
@ -19,17 +19,21 @@ import (
|
||||
|
||||
// TerraformUpgradeVars returns variables required to execute the Terraform scripts.
|
||||
func TerraformUpgradeVars(conf *config.Config) (terraform.Variables, error) {
|
||||
// Note that we pass "" as imageRef, as we ignore changes to the image in the terraform.
|
||||
// Note that we don't pass any real image as imageRef, as we ignore changes to the image in the terraform.
|
||||
// The image is updates via our operator.
|
||||
// Still, the terraform variable verification must accept the values.
|
||||
// For AWS, we enforce some basic constraints on the image variable.
|
||||
// For Azure, the provider enforces the format below.
|
||||
// For GCP, any placeholder works.
|
||||
switch conf.GetProvider() {
|
||||
case cloudprovider.AWS:
|
||||
vars := awsTerraformVars(conf, "")
|
||||
vars := awsTerraformVars(conf, "ami-placeholder")
|
||||
return vars, nil
|
||||
case cloudprovider.Azure:
|
||||
vars := azureTerraformVars(conf, "")
|
||||
vars := azureTerraformVars(conf, "/communityGalleries/myGalleryName/images/myImageName/versions/latest")
|
||||
return vars, nil
|
||||
case cloudprovider.GCP:
|
||||
vars := gcpTerraformVars(conf, "")
|
||||
vars := gcpTerraformVars(conf, "placeholder")
|
||||
return vars, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported provider: %s", conf.GetProvider())
|
||||
|
Loading…
Reference in New Issue
Block a user