flying1pig opened a new pull request #465:
URL: https://github.com/apache/apisix-ingress-controller/pull/465


   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [ ] Bugfix
   
   - Related issues
   bug: endpoint controller sync changes failed #464
   ___
   ### Bugfix
   - Description
   
   - How to fix?
   
   --- endpoint.go      2021-05-18 17:07:30.260831523 +0800
   +++ endpoint1.go     2021-05-18 17:06:41.762820080 +0800
   @@ -107,6 +107,20 @@
        }
        clusters := c.controller.apisix.ListClusters()
   
   +    //endpoints turn to zero
   +    if len(ep.Subsets) == 0 {
   +            nodes := []apisixv1.UpstreamNode{}
   +            for _, port := range svc.Spec.Ports {
   +                    svcPort := port.Port
   +                    name := apisixv1.ComposeUpstreamName(ep.Namespace, 
ep.Name, svcPort)
   +                    for _, cluster := range clusters {
   +                            if err := c.syncToCluster(ctx, cluster, nodes, 
name); err != nil {
   +                                    return err
   +                            }
   +                    }
   +            }
   +    }
   +
        for _, s := range ep.Subsets {
                for _, port := range s.Ports {
                        svcPort, ok := portMap[port.Name]
   
   ___
   ### New feature or improvement
   - Describe the details and related test reports.
   
   ___
   ### Backport patches
   - Why need to backport?
   
   - Source branch
   v0.4.0
   
   - Related commits and pull requests
   
   - Target branch
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to