config: add SEV-SNP config options for GCP

This commit is contained in:
Moritz Sanft 2024-04-04 16:31:41 +02:00
parent 3a349b1a15
commit b9a982d1d3
No known key found for this signature in database
GPG key ID: 335D28368B1DA615
8 changed files with 247 additions and 33 deletions

View file

@ -202,6 +202,9 @@ func validateAttestation(sl validator.StructLevel) {
if attestation.GCPSEVES != nil {
attestationCount++
}
if attestation.GCPSEVSNP != nil {
attestationCount++
}
if attestation.QEMUVTPM != nil {
attestationCount++
}
@ -364,6 +367,9 @@ func (c *Config) translateMoreThanOneAttestationError(ut ut.Translator, fe valid
if c.Attestation.GCPSEVES != nil {
definedAttestations = append(definedAttestations, "GCPSEVES")
}
if c.Attestation.GCPSEVSNP != nil {
definedAttestations = append(definedAttestations, "GCPSEVSNP")
}
if c.Attestation.QEMUVTPM != nil {
definedAttestations = append(definedAttestations, "QEMUVTPM")
}
@ -536,7 +542,7 @@ func validInstanceTypeForProvider(insType string, attestation variant.Variant) b
return true
}
}
case variant.GCPSEVES{}:
case variant.GCPSEVES{}, variant.GCPSEVSNP{}:
for _, instanceType := range instancetypes.GCPInstanceTypes {
if insType == instanceType {
return true