go-bigip icon indicating copy to clipboard operation
go-bigip copied to clipboard

Fix issue where pool settings gets overwritten when adding a monitor

Open kokhang opened this issue 9 years ago • 2 comments
trafficstars

Fixing it by getting a reference of the pool and adding the monitor to it. #13

kokhang avatar Jul 07 '16 21:07 kokhang

Gah, this happens b/c Go doesn't have nullable primitives so we can't tell when to ignore sending a value. Plus the build in json marshaller is fairly limited is customization w/o handling the marshaling for all objects by hand.

It's a bummer to have to make an extra round trip call. To get around that we could have an object just for this call which only sends in the monitor name. Then only that field would get set on the pool and leave the others intact.

Something like:

type PoolMonitor struct {
  Monitor string `json:"monitor,omitempty"`
}

Then send that in as the config instead of a full Pool. I would vote for avoiding an extra round trip call where possible.

aburnett avatar Jul 08 '16 01:07 aburnett

I would not accept this solution because using PATCH http method this can be solved correctly. Now there is possibility that someone else will update configuration between these two requests and then changes will be lost

zetaab avatar Mar 13 '18 14:03 zetaab