Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

session.VirtualAddresses() failed to parse json response if RouteAdvertisement is "selective" #50

Open
hoangnng opened this issue Aug 11, 2020 · 1 comment

Comments

@hoangnng
Copy link

Issue:
Calling session.VirtualAddresses() with a VIP's RouteAdvertisement set to "selective" caused this error

Getting error: 2020-08-10_20:32:31.10538 I0810 20:32:31.105345 9459 tim_f5_ingestor.go:301] Polling failed (failed to list virtual addresses on F5 5f31ac7d497d4f723ca20dff: Unknown boolean conversion for RouteAdvertisement: selective)

This happens after upgrading big-ip to 13.0.

Analysis:
It appears the json declaration for virtualAddressDTO still uses the old value "enabled" for RouteAdvertisement
https://github.com/f5devcentral/go-bigip/blob/master/ltm.go#L596
This is a knowledge base article about the change of "enabled" to "selective" for RouteAdvertisement
https://support.f5.com/csp/article/K85543242

Proposed fix:

diff --git a/golang/src/vendor/github.com/f5devcentral/go-bigip/ltm.go b/golang/src/vendor/github.com/f5devcentral/go-bigip/ltm.go
index eb78ec6cbcf..a79d5266863 100644
--- a/golang/src/vendor/github.com/f5devcentral/go-bigip/ltm.go
+++ b/golang/src/vendor/github.com/f5devcentral/go-bigip/ltm.go
@@ -567,7 +567,7 @@ type virtualAddressDTO struct {
        ICMPEcho              string `json:"icmpEcho,omitempty" bool:"enabled"`
        InheritedTrafficGroup string `json:"inheritedTrafficGroup,omitempty" bool:"yes"`
        Mask                  string `json:"mask,omitempty"`
-       RouteAdvertisement    string `json:"routeAdvertisement,omitempty" bool:"enabled"`
+       RouteAdvertisement    string `json:"routeAdvertisement,omitempty" bool:"selective"`
        ServerScope           string `json:"serverScope,omitempty"`
        TrafficGroup          string `json:"trafficGroup,omitempty"`
        Unit                  int    `json:"unit,omitempty"`
@hoangnng
Copy link
Author

The proposed fix in previous comment will not work as RouteAdvertisement is an enum (disabled, enabled, selective, always, all, any). This change in bigip rest api >=13.0 does not consider backward compatibility for go client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant