Skip to content

Commit

Permalink
Merge pull request #65 from backguynn/multicluster-v1
Browse files Browse the repository at this point in the history
Change variable name
  • Loading branch information
backguynn authored Oct 16, 2023
2 parents 4c7598e + a7cbe37 commit bfb65f7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/agent/manager/loadbalancer/loadbalancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -655,14 +655,14 @@ func (m *Manager) addLoadBalancer(svc *corev1.Service) error {
for _, lb := range lbModelList {
// TODO: Need to review to make sure there are no duplicate names.
// TODO: Who manages the external IP in multicluster mode?
var what *v1.MultiClusterLBService
var newCrd *v1.MultiClusterLBService

crdName := fmt.Sprintf("%s-%s:%d", lb.LbModel.Service.Protocol, lb.LbModel.Service.ExternalIP, lb.LbModel.Service.Port)
what.Name = crdName
what.Labels["loxilb.io/cluster"] = m.networkConfig.ClusterName
what.Spec = v1.MultiClusterLBServiceSpec{Model: v1.MultiClusterLBModel(lbModel)}
newCrd.Name = crdName
newCrd.Labels["loxilb.io/cluster"] = m.networkConfig.ClusterName
newCrd.Spec = v1.MultiClusterLBServiceSpec{Model: v1.MultiClusterLBModel(lbModel)}

_, err := m.masterCrdClient.MulticlusterV1().MultiClusterLBServices().Create(ctx, what, metav1.CreateOptions{})
_, err := m.masterCrdClient.MulticlusterV1().MultiClusterLBServices().Create(ctx, newCrd, metav1.CreateOptions{})
if err != nil {
retIPAMOnErr = true
klog.Errorf("failed to add load-balancer CRD to main cluster")
Expand Down

0 comments on commit bfb65f7

Please sign in to comment.