mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-06 08:15:48 -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
1 changed files with 8 additions and 4 deletions
|
@ -19,17 +19,21 @@ import (
|
||||||
|
|
||||||
// TerraformUpgradeVars returns variables required to execute the Terraform scripts.
|
// TerraformUpgradeVars returns variables required to execute the Terraform scripts.
|
||||||
func TerraformUpgradeVars(conf *config.Config) (terraform.Variables, error) {
|
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.
|
// 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() {
|
switch conf.GetProvider() {
|
||||||
case cloudprovider.AWS:
|
case cloudprovider.AWS:
|
||||||
vars := awsTerraformVars(conf, "")
|
vars := awsTerraformVars(conf, "ami-placeholder")
|
||||||
return vars, nil
|
return vars, nil
|
||||||
case cloudprovider.Azure:
|
case cloudprovider.Azure:
|
||||||
vars := azureTerraformVars(conf, "")
|
vars := azureTerraformVars(conf, "/communityGalleries/myGalleryName/images/myImageName/versions/latest")
|
||||||
return vars, nil
|
return vars, nil
|
||||||
case cloudprovider.GCP:
|
case cloudprovider.GCP:
|
||||||
vars := gcpTerraformVars(conf, "")
|
vars := gcpTerraformVars(conf, "placeholder")
|
||||||
return vars, nil
|
return vars, nil
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("unsupported provider: %s", conf.GetProvider())
|
return nil, fmt.Errorf("unsupported provider: %s", conf.GetProvider())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue