mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-06-20 04:04:21 -04:00
cli: allow tagging cloud resources with custom tags (#3033)
This commit is contained in:
parent
f60c133724
commit
b187966581
27 changed files with 172 additions and 42 deletions
|
@ -104,6 +104,7 @@ func awsTerraformVars(conf *config.Config, imageRef string) *terraform.AWSCluste
|
|||
EnableSNP: conf.GetAttestationConfig().GetVariant().Equal(variant.AWSSEVSNP{}),
|
||||
CustomEndpoint: conf.CustomEndpoint,
|
||||
InternalLoadBalancer: conf.InternalLoadBalancer,
|
||||
AdditionalTags: conf.Tags,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -158,6 +159,7 @@ func azureTerraformVars(conf *config.Config, imageRef string) (*terraform.AzureC
|
|||
CustomEndpoint: conf.CustomEndpoint,
|
||||
InternalLoadBalancer: conf.InternalLoadBalancer,
|
||||
MarketplaceImage: nil,
|
||||
AdditionalTags: conf.Tags,
|
||||
}
|
||||
|
||||
if conf.UseMarketplaceImage() {
|
||||
|
@ -226,6 +228,7 @@ func gcpTerraformVars(conf *config.Config, imageRef string) *terraform.GCPCluste
|
|||
CustomEndpoint: conf.CustomEndpoint,
|
||||
InternalLoadBalancer: conf.InternalLoadBalancer,
|
||||
CCTechnology: ccTech,
|
||||
AdditionalLabels: conf.Tags,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -261,6 +264,14 @@ func openStackTerraformVars(conf *config.Config, imageRef string) (*terraform.Op
|
|||
StateDiskType: group.StateDiskType,
|
||||
}
|
||||
}
|
||||
|
||||
// since openstack does not support tags in the form of key = value, the tags will be converted
|
||||
// to an array of "key=value" strings
|
||||
tags := []string{}
|
||||
for key, value := range conf.Tags {
|
||||
tags = append(tags, fmt.Sprintf("%s=%s", key, value))
|
||||
}
|
||||
|
||||
return &terraform.OpenStackClusterVariables{
|
||||
Name: conf.Name,
|
||||
Cloud: toPtr(conf.Provider.OpenStack.Cloud),
|
||||
|
@ -272,6 +283,7 @@ func openStackTerraformVars(conf *config.Config, imageRef string) (*terraform.Op
|
|||
CustomEndpoint: conf.CustomEndpoint,
|
||||
InternalLoadBalancer: conf.InternalLoadBalancer,
|
||||
STACKITProjectID: conf.Provider.OpenStack.STACKITProjectID,
|
||||
AdditionalTags: tags,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue