mirror of
https://github.com/edgelesssys/constellation.git
synced 2024-12-26 16:09:45 -05:00
Upgrade config to v2
This commit is contained in:
parent
575b6e93f6
commit
1331c171c3
@ -34,15 +34,15 @@ import (
|
||||
type Measurements = measurements.M
|
||||
|
||||
const (
|
||||
// Version1 is the first version number for Constellation config file.
|
||||
Version1 = "v1"
|
||||
// Version2 is the second version number for Constellation config file.
|
||||
Version2 = "v2"
|
||||
)
|
||||
|
||||
// Config defines configuration used by CLI.
|
||||
type Config struct {
|
||||
// description: |
|
||||
// Schema version of this configuration file.
|
||||
Version string `yaml:"version" validate:"eq=v1"`
|
||||
Version string `yaml:"version" validate:"eq=v2"`
|
||||
// description: |
|
||||
// Machine image used to create Constellation nodes.
|
||||
Image string `yaml:"image" validate:"required,safe_image"`
|
||||
@ -264,7 +264,7 @@ type QEMUConfig struct {
|
||||
// Default returns a struct with the default config.
|
||||
func Default() *Config {
|
||||
return &Config{
|
||||
Version: Version1,
|
||||
Version: Version2,
|
||||
Image: defaultImage,
|
||||
StateDiskSizeGB: 30,
|
||||
DebugCluster: func() *bool { b := false; return &b }(),
|
||||
|
@ -64,11 +64,11 @@ func TestFromFile(t *testing.T) {
|
||||
},
|
||||
"custom config from default file": {
|
||||
config: &Config{
|
||||
Version: Version1,
|
||||
Version: Version2,
|
||||
},
|
||||
configName: constants.ConfigFilename,
|
||||
wantResult: &Config{
|
||||
Version: Version1,
|
||||
Version: Version2,
|
||||
},
|
||||
},
|
||||
"modify default config": {
|
||||
|
Loading…
Reference in New Issue
Block a user