Skip to content

Commit

Permalink
fix:修复配置中心链接端口错误问题 (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
chuntaojun authored Dec 26, 2023
1 parent 4875d04 commit b8c406a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion cmd/polaris-controller/app/polaris-controller-manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ func initControllerConfig(s *options.KubeControllerManagerOptions) {
polarisServerAddress = strings.TrimSpace(polarisServerAddress)
polarisapi.PolarisHttpURL = "http://" + polarisServerAddress + ":" + strconv.Itoa(flags.httpPort)
polarisapi.PolarisGrpc = polarisServerAddress + ":" + strconv.Itoa(flags.grpcPort)
log.Infof("[Manager] polaris http address %s, grpc address %s", polarisapi.PolarisHttpURL, polarisapi.PolarisGrpc)
polarisapi.PolarisConfigGrpc = polarisServerAddress + ":8093"
log.Infof("[Manager] polaris http address %s, discover grpc address %s, config grpc address %s",
polarisapi.PolarisHttpURL, polarisapi.PolarisGrpc, polarisapi.PolarisConfigGrpc)
// 设置北极星开启鉴权之后,需要使用的访问token
polarisapi.PolarisAccessToken = config.ServiceSync.PolarisAccessToken
polarisapi.PolarisOperator = config.ServiceSync.Operator
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ func (p *PolarisController) onConfigMapDelete(cur interface{}) {
}

func (p *PolarisController) watchPolarisConfig() error {
conn, err := grpc.Dial(polarisapi.PolarisGrpc, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.Dial(polarisapi.PolarisConfigGrpc, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return err
}
Expand Down
1 change: 0 additions & 1 deletion pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ func NewPolarisController(
p.provider = providerAPI

p.config = config

return p, p.watchPolarisConfig()
}

Expand Down
1 change: 1 addition & 0 deletions pkg/polarisapi/service_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
var (
PolarisHttpURL = "http://127.0.0.1:8090"
PolarisGrpc = "127.0.0.1:8091"
PolarisConfigGrpc = "127.0.0.1:8093"
PolarisAccessToken = ""
PolarisOperator = ""
)
Expand Down

0 comments on commit b8c406a

Please sign in to comment.