chiradeep / go-nitro

A Golang client to the Citrix ADC API
Apache License 2.0
18 stars 21 forks source link

Can't set lbvserver resource to have persistence timeout of 0 #44

Open BraddMPiontek opened 4 years ago

BraddMPiontek commented 4 years ago

We are using this API indirectly via the terrafrom citrixadc provider and are having the issue described in this issue.

The issue I'm seeing is we can't set the lb_persistenttimeout (Timeout) on the netscaler because when I do this, the value of zero is omitted from the JSON payload, even though this is a valid value (and is the preferred value for this setting per citrix docs)

chiradeep commented 4 years ago

this line? https://github.com/chiradeep/go-nitro/blob/a932247d99eac203c300499379dffc8026902fd7/config/lb/lbpersistentsessions.go#L15

BraddMPiontek commented 4 years ago

No, the specific one I care about is:

https://github.com/chiradeep/go-nitro/blob/master/config/lb/lbvserver.go#L125

However, this would apply to any netscaler integers where 0 is a valid value.

I forked your code and removed the omitempty (as a simple test, this likely is not the right solution) and built it into the terraform-provider-vshere provider, and tested with that and I'm now able to set that specific value to 0