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