Skip to content

Commit fc2e947

Browse files
committed
Fix static IP allocation
When creating a VIP if autoallocate is set along with static IP, autoallocate is taking over precedence. Signed-off-by: Dinar Valeev <[email protected]>
1 parent cf4b379 commit fc2e947

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

internal/rest/avi_obj_vsvip.go

+2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,10 @@ func (rest *RestOperations) AviVsVipBuild(vsvip_meta *nodes.AviVSVIPNode, vsCach
108108
if vsvip_meta.IPAddress != "" {
109109
if utils.IsV4(vsvip_meta.IPAddress) {
110110
vip.IPAddress = &avimodels.IPAddr{Type: &ipType, Addr: &vsvip_meta.IPAddress}
111+
vip.AutoAllocateIP = utils.BoolToPtr(false)
111112
} else {
112113
vip.Ip6Address = &avimodels.IPAddr{Type: &ip6Type, Addr: &vsvip_meta.IPAddress}
114+
vip.AutoAllocateIP = utils.BoolToPtr(false)
113115
}
114116
}
115117

pkg/utils/utils.go

+4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ func IsV4(addr string) bool {
5858
return v4 != nil
5959
}
6060

61+
func BoolToPtr(b bool) *bool {
62+
return &b
63+
}
64+
6165
/*
6266
* Port name is either "http" or "http-suffix"
6367
* Following Istio named port convention

0 commit comments

Comments
 (0)