config: fix fetcher parse azure sev-snp version (#1911)

This commit is contained in:
Adrian Stobbe 2023-06-12 16:04:54 +02:00 committed by GitHub
parent ab74730fd7
commit 4f63481b7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 13 deletions

View file

@ -18,6 +18,9 @@ import (
"github.com/edgelesssys/constellation/v2/internal/staticupload"
)
// VersionFormat is the format of the version name in the S3 bucket.
const VersionFormat = "2006-01-02-15-04"
// Client manages (modifies) the version information for the attestation variants.
type Client struct {
s3Client *apiclient.Client
@ -105,7 +108,7 @@ func (a Client) deleteAzureSEVSNPVersion(versions AzureSEVSNPVersionList, versio
}
func (a Client) uploadAzureSEVSNP(versions AzureSEVSNPVersion, versionNames []string, date time.Time) (res []crudCmd, err error) {
dateStr := date.Format("2006-01-02-15-04") + ".json"
dateStr := date.Format(VersionFormat) + ".json"
res = append(res, putCmd{AzureSEVSNPVersionAPI{Version: dateStr, AzureSEVSNPVersion: versions}})