File tree 1 file changed +7
-17
lines changed
1 file changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -159,24 +159,14 @@ func TestConfigFileFeatureGates(t *testing.T) {
159
159
t .Run (tc .name , func (t * testing.T ) {
160
160
var b []byte
161
161
var err error
162
- if tc .setExperimentalStopGRPCServiceOnDefrag {
163
- yc := struct {
164
- ExperimentalStopGRPCServiceOnDefrag bool `json:"experimental-stop-grpc-service-on-defrag"`
165
- FeatureGatesJSON string `json:"feature-gates"`
166
- }{
167
- tc .experimentalStopGRPCServiceOnDefrag ,
168
- tc .featureGatesJSON ,
169
- }
170
- b , err = yaml .Marshal (& yc )
171
- } else {
172
- yc := struct {
173
- FeatureGatesJSON string `json:"feature-gates"`
174
- }{
175
-
176
- tc .featureGatesJSON ,
177
- }
178
- b , err = yaml .Marshal (& yc )
162
+ data := map [string ]string {}
163
+ if tc .featureGatesJSON != "" {
164
+ data ["feature-gates" ] = tc .featureGatesJSON
165
+ }
166
+ if tc .experimentalStopGRPCServiceOnDefrag != "" {
167
+ data ["experimental-stop-grpc-service-on-defrag" ] = tc .experimentalStopGRPCServiceOnDefrag
179
168
}
169
+ b , err = yaml .Marshal (& yc )
180
170
if err != nil {
181
171
t .Fatal (err )
182
172
}
You can’t perform that action at this time.
0 commit comments