Skip to content

Commit

Permalink
fix: cdn AdvertiseIP not used (#782)
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Ma <[email protected]>
  • Loading branch information
jim3ma authored Nov 8, 2021
1 parent 077c7e2 commit ec8ede0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cdn/cdn.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

// Package cdnsystem cdn server
package cdn

import (
Expand Down Expand Up @@ -176,7 +175,11 @@ func (s *Server) Serve() error {
}

// Generate GRPC listener
lis, _, err := rpc.ListenWithPortRange(iputils.HostIP, s.config.ListenPort, s.config.ListenPort)
var listen = iputils.HostIP
if s.config.AdvertiseIP != "" {
listen = s.config.AdvertiseIP
}
lis, _, err := rpc.ListenWithPortRange(listen, s.config.ListenPort, s.config.ListenPort)
if err != nil {
logger.Fatalf("net listener failed to start: %+v", err)
}
Expand Down

0 comments on commit ec8ede0

Please sign in to comment.