mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-07 16:55:15 -04:00
config: enable azure snp version fetcher again + minimum age for latest version (#1899)
* fetch latest version when older than 2 weeks
* extend hack upload tool to pass an upload date
* Revert "config: disable user-facing version Azure SEV SNP fetch for v2.8 (#1882)"
This reverts commit c7b22d314a
.
* fix tests
* use NewAzureSEVSNPVersionList for type guarantees
* Revert "use NewAzureSEVSNPVersionList for type guarantees"
This reverts commit 942566453f4b4a2b6dc16f8689248abf1dc47db4.
* assure list is sorted
* improve root.go style
* daniel feedback
This commit is contained in:
parent
72e168e653
commit
3fde118b33
13 changed files with 239 additions and 189 deletions
|
@ -9,7 +9,6 @@ package config
|
|||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
@ -45,39 +44,3 @@ func TestVersionMarshalYAML(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestVersionUnmarshalYAML(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
expected AttestationVersion
|
||||
yamlInput string
|
||||
wantErr bool
|
||||
}{
|
||||
// TODO(elchead): activate latest logic for next release AB#3036
|
||||
{
|
||||
name: "latest value is not allowed",
|
||||
expected: AttestationVersion{},
|
||||
yamlInput: "latest\n",
|
||||
wantErr: true,
|
||||
},
|
||||
{
|
||||
name: "value 5 resolves to 5",
|
||||
expected: AttestationVersion{
|
||||
Value: 5,
|
||||
},
|
||||
yamlInput: "5\n",
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
sut := AttestationVersion{}
|
||||
err := yaml.Unmarshal([]byte(tt.yamlInput), &sut)
|
||||
if tt.wantErr {
|
||||
assert.Error(t, err)
|
||||
return
|
||||
}
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, tt.expected.IsLatest, sut.IsLatest)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue