File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -825,6 +825,10 @@ func TestCreateEditDeleteBackend(t *testing.T) {
825825 {Name : "test_errors_all" },
826826 },
827827 Disabled : true ,
828+ Redispatch : & models.Redispatch {
829+ Enabled : misc .StringP ("enabled" ),
830+ Interval : 0 ,
831+ },
828832 }
829833
830834 err := clientTest .CreateBackend (b , "" , version )
@@ -839,6 +843,9 @@ func TestCreateEditDeleteBackend(t *testing.T) {
839843 t .Error (err .Error ())
840844 }
841845
846+ // A redispatch with a zero interval is automatically removed from configuration.
847+ b .Redispatch = nil
848+
842849 var givenJSONB []byte
843850 givenJSONB , err = b .MarshalBinary ()
844851 if err != nil {
Original file line number Diff line number Diff line change @@ -2443,6 +2443,9 @@ func (s *SectionObject) redispatch(field reflect.Value) error {
24432443 if * br .Enabled == "disabled" {
24442444 d .NoOption = true
24452445 }
2446+ if br .Interval == 0 {
2447+ d = nil
2448+ }
24462449 if err := s .set ("option redispatch" , d ); err != nil {
24472450 return err
24482451 }
You can’t perform that action at this time.
0 commit comments