Upgrade config to v2

This commit is contained in:
Malte Poll 2022-11-22 15:53:39 +01:00 committed by Malte Poll
parent 575b6e93f6
commit 1331c171c3
2 changed files with 6 additions and 6 deletions

View File

@ -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 }(),

View File

@ -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": {