mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-10 07:50:08 -04:00
AB#2278 Remove hardcoded values from config (#346)
* Update file handler to avoid incorrect usage of file.Option * Remove hardcoded values Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
129caae0e4
commit
ab536ae3c8
7 changed files with 95 additions and 51 deletions
|
@ -17,8 +17,44 @@ func TestValidateConfig(t *testing.T) {
|
|||
wantOutput bool
|
||||
wantErr bool
|
||||
}{
|
||||
"default config is valid": {
|
||||
cnf: config.Default(),
|
||||
"default config is not valid": {
|
||||
cnf: config.Default(),
|
||||
wantOutput: true,
|
||||
wantErr: true,
|
||||
},
|
||||
"default Azure config is not valid": {
|
||||
cnf: func() *config.Config {
|
||||
cnf := config.Default()
|
||||
az := cnf.Provider.Azure
|
||||
cnf.Provider = config.ProviderConfig{}
|
||||
cnf.Provider.Azure = az
|
||||
return cnf
|
||||
}(),
|
||||
provider: cloudprovider.Azure,
|
||||
wantOutput: true,
|
||||
wantErr: true,
|
||||
},
|
||||
"default GCP config is not valid": {
|
||||
cnf: func() *config.Config {
|
||||
cnf := config.Default()
|
||||
gcp := cnf.Provider.GCP
|
||||
cnf.Provider = config.ProviderConfig{}
|
||||
cnf.Provider.GCP = gcp
|
||||
return cnf
|
||||
}(),
|
||||
provider: cloudprovider.GCP,
|
||||
wantOutput: true,
|
||||
wantErr: true,
|
||||
},
|
||||
"default QEMU config is valid": {
|
||||
cnf: func() *config.Config {
|
||||
cnf := config.Default()
|
||||
qemu := cnf.Provider.QEMU
|
||||
cnf.Provider = config.ProviderConfig{}
|
||||
cnf.Provider.QEMU = qemu
|
||||
return cnf
|
||||
}(),
|
||||
provider: cloudprovider.QEMU,
|
||||
},
|
||||
"config with an error": {
|
||||
cnf: func() *config.Config {
|
||||
|
@ -36,16 +72,6 @@ func TestValidateConfig(t *testing.T) {
|
|||
return cnf
|
||||
}(),
|
||||
},
|
||||
"config with only required provider": {
|
||||
cnf: func() *config.Config {
|
||||
cnf := config.Default()
|
||||
az := cnf.Provider.Azure
|
||||
cnf.Provider = config.ProviderConfig{}
|
||||
cnf.Provider.Azure = az
|
||||
return cnf
|
||||
}(),
|
||||
provider: cloudprovider.Azure,
|
||||
},
|
||||
"config without required provider": {
|
||||
cnf: func() *config.Config {
|
||||
cnf := config.Default()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue