mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-01 19:46:07 -04:00
uplosi: use separate galleries for Azure TDX and TDX
This commit is contained in:
parent
52dec77508
commit
9d6321faa3
2 changed files with 19 additions and 8 deletions
|
@ -209,21 +209,32 @@ func awsParseAMIARN(arn string) (region string, amiID string, retErr error) {
|
|||
|
||||
func extendAzureConfig(azureConfig map[string]any, version versionsapi.Version, attestationVariant string, timestamp time.Time) {
|
||||
azureConfig["attestationVariant"] = attestationVariant
|
||||
azureConfig["sharedImageGallery"] = azureGalleryName(version)
|
||||
azureConfig["sharedImageGallery"] = azureGalleryName(version, attestationVariant)
|
||||
azureConfig["imageDefinitionName"] = azureImageOffer(version)
|
||||
azureConfig["offer"] = azureImageOffer(version)
|
||||
formattedTime := timestamp.Format(timestampFormat)
|
||||
azureConfig["diskName"] = fmt.Sprintf("constellation-%s-%s-%s", version.Stream(), formattedTime, attestationVariant)
|
||||
}
|
||||
|
||||
func azureGalleryName(version versionsapi.Version) string {
|
||||
func azureGalleryName(version versionsapi.Version, attestationVariant string) string {
|
||||
var prefix string
|
||||
switch version.Stream() {
|
||||
case "stable":
|
||||
return "Constellation_CVM"
|
||||
prefix = "Constellation"
|
||||
case "debug":
|
||||
return "Constellation_Debug_CVM"
|
||||
prefix = "Constellation_Debug"
|
||||
default:
|
||||
prefix = "Constellation_Testing"
|
||||
}
|
||||
return "Constellation_Testing_CVM"
|
||||
|
||||
var suffix string
|
||||
switch attestationVariant {
|
||||
case "azure-tdx":
|
||||
suffix = "_TDX"
|
||||
case "azure-sev-snp":
|
||||
suffix = "_CVM"
|
||||
}
|
||||
return prefix + suffix
|
||||
}
|
||||
|
||||
func azureImageOffer(version versionsapi.Version) string {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue