File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
pkg/operator/configobservation/apiserver Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,30 @@ func TestObserveGoawayChance(t *testing.T) {
88
88
"goaway-chance" : []interface {}{"0" },
89
89
}},
90
90
},
91
+
92
+ // scenario 8 - Invalid goaway-chance value (negative)
93
+ {
94
+ name : "invalid: negative value" ,
95
+ controlPlaneTopology : configv1 .HighlyAvailableTopologyMode ,
96
+ existingKubeAPIConfig : map [string ]interface {}{"apiServerArguments" : map [string ]interface {}{
97
+ "goaway-chance" : []interface {}{"-0.1" },
98
+ }},
99
+ expectedKubeAPIConfig : map [string ]interface {}{"apiServerArguments" : map [string ]interface {}{
100
+ "goaway-chance" : []interface {}{"0.001" },
101
+ }},
102
+ },
103
+
104
+ // scenario 9 - Invalid goaway-chance value (greater than 0.2)
105
+ {
106
+ name : "invalid: value greater than 0.2" ,
107
+ controlPlaneTopology : configv1 .HighlyAvailableTopologyMode ,
108
+ existingKubeAPIConfig : map [string ]interface {}{"apiServerArguments" : map [string ]interface {}{
109
+ "goaway-chance" : []interface {}{"0.3" },
110
+ }},
111
+ expectedKubeAPIConfig : map [string ]interface {}{"apiServerArguments" : map [string ]interface {}{
112
+ "goaway-chance" : []interface {}{"0.001" },
113
+ }},
114
+ },
91
115
}
92
116
93
117
for _ , scenario := range scenarios {
You can’t perform that action at this time.
0 commit comments