Skip to content

Commit

Permalink
Merge pull request #147 from backguynn/main
Browse files Browse the repository at this point in the history
add privateIP to apt.LoadBalancerModel
  • Loading branch information
backguynn committed Jun 18, 2024
2 parents a309840 + 921c88d commit d704707
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/agent/manager/loadbalancer/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -826,11 +826,12 @@ func (m *Manager) addLoadBalancer(svc *corev1.Service) error {
klog.Infof("Secondary IP Pairs %v", m.lbCache[cacheKey].SecIPs)
}

privateIP, _, _ := net.ParseCIDR(m.networkConfig.PrivateCIDR)
for _, ingSvcPair := range ingSvcPairs {
var errChList []chan error
lbArgs := LbArgs{
externalIP: ingSvcPair.IPString,
privateIP: m.networkConfig.PrivateCIDR,
privateIP: privateIP.String(),
livenessCheck: m.lbCache[cacheKey].ActCheck,
lbMode: m.lbCache[cacheKey].LbMode,
timeout: m.lbCache[cacheKey].Timeout,
Expand Down Expand Up @@ -1547,6 +1548,7 @@ func (m *Manager) makeLoxiLoadBalancerModel(lbArgs *LbArgs, svc *corev1.Service,
return api.LoadBalancerModel{
Service: api.LoadBalancerService{
ExternalIP: lbArgs.externalIP,
PrivateIP: lbArgs.privateIP,
Port: uint16(port.Port),
Protocol: strings.ToLower(string(port.Protocol)),
BGP: bgpMode,
Expand Down
1 change: 1 addition & 0 deletions pkg/api/lb.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ func (lbModel *LoadBalancerModel) GetKeyStruct() LoxiModel {

type LoadBalancerService struct {
ExternalIP string `json:"externalIP" key:"externalipaddress"`
PrivateIP string `json:"privateIP" key:"privateipaddress"`
Port uint16 `json:"port" key:"port"`
Protocol string `json:"protocol" key:"protocol"`
Sel EpSelect `json:"sel"`
Expand Down

0 comments on commit d704707

Please sign in to comment.