mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-08-06 05:54:28 -04:00
Remove firewall configuration and make it static with a debug flag
This commit is contained in:
parent
23bf4aa665
commit
1a4b4f564a
6 changed files with 157 additions and 155 deletions
|
@ -288,7 +288,6 @@ func TestConfigGeneratedDocsFresh(t *testing.T) {
|
|||
assert.Len(ConfigDoc.Fields, reflect.ValueOf(Config{}).NumField(), updateMsg)
|
||||
assert.Len(UpgradeConfigDoc.Fields, reflect.ValueOf(UpgradeConfig{}).NumField(), updateMsg)
|
||||
assert.Len(UserKeyDoc.Fields, reflect.ValueOf(UserKey{}).NumField(), updateMsg)
|
||||
assert.Len(FirewallRuleDoc.Fields, reflect.ValueOf(FirewallRule{}).NumField(), updateMsg)
|
||||
assert.Len(ProviderConfigDoc.Fields, reflect.ValueOf(ProviderConfig{}).NumField(), updateMsg)
|
||||
assert.Len(AzureConfigDoc.Fields, reflect.ValueOf(AzureConfig{}).NumField(), updateMsg)
|
||||
assert.Len(GCPConfigDoc.Fields, reflect.ValueOf(GCPConfig{}).NumField(), updateMsg)
|
||||
|
@ -474,3 +473,36 @@ func TestValidInstanceTypeForProvider(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsDebugCluster(t *testing.T) {
|
||||
testCases := map[string]struct {
|
||||
config *Config
|
||||
prepareConfig func(*Config)
|
||||
expectedResult bool
|
||||
}{
|
||||
"empty config": {
|
||||
config: &Config{},
|
||||
expectedResult: false,
|
||||
},
|
||||
"default config": {
|
||||
config: Default(),
|
||||
expectedResult: false,
|
||||
},
|
||||
"enabled": {
|
||||
config: Default(),
|
||||
prepareConfig: func(conf *Config) {
|
||||
*conf.DebugCluster = true
|
||||
},
|
||||
expectedResult: true,
|
||||
},
|
||||
}
|
||||
for name, tc := range testCases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
if tc.prepareConfig != nil {
|
||||
tc.prepareConfig(tc.config)
|
||||
}
|
||||
assert.Equal(tc.expectedResult, tc.config.IsDebugCluster())
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue