Skip to content

Commit

Permalink
fix: fix Security vulnerability (#1646)
Browse files Browse the repository at this point in the history
Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com>
  • Loading branch information
cubxxw committed Jan 1, 2024
1 parent bed112d commit 49f4e3f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ services:

## Uncomment and configure the following services as needed
# openim-admin:
# image: ${IMAGE_REGISTRY:-ghcr.io/openimsdk}/openim-admin-front:v3.4.0
# image: ${IMAGE_REGISTRY:-ghcr.io/openimsdk}/openim-admin:toc-base-open-docker.35
# container_name: openim-admin
# restart: always
# ports:
Expand Down
8 changes: 8 additions & 0 deletions pkg/common/discoveryregister/kubernetes/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,17 @@ func (cli *K8sDR) Register(serviceName, host string, port int, opts ...grpc.Dial

return nil
}

func (cli *K8sDR) UnRegister() error {

return nil
}

func (cli *K8sDR) CreateRpcRootNodes(serviceNames []string) error {

return nil
}

func (cli *K8sDR) RegisterConf2Registry(key string, conf []byte) error {

return nil
Expand Down Expand Up @@ -123,6 +126,8 @@ func getMsgGatewayHost(ctx context.Context) []string {
log.ZInfo(ctx, "getMsgGatewayHost", "instance", instance, "selfPodName", selfPodName, "replicas", replicas, "ns", ns, "ret", ret)
return ret
}

// GetConns returns the gRPC client connections to the specified service.
func (cli *K8sDR) GetConns(ctx context.Context, serviceName string, opts ...grpc.DialOption) ([]*grpc.ClientConn, error) {

if serviceName != config.Config.RpcRegisterName.OpenImMessageGatewayName {
Expand All @@ -142,6 +147,7 @@ func (cli *K8sDR) GetConns(ctx context.Context, serviceName string, opts ...grpc
return ret, nil
}
}

func (cli *K8sDR) GetConn(ctx context.Context, serviceName string, opts ...grpc.DialOption) (*grpc.ClientConn, error) {

return grpc.DialContext(ctx, serviceName, append(cli.options, opts...)...)
Expand All @@ -151,9 +157,11 @@ func (cli *K8sDR) GetSelfConnTarget() string {

return cli.rpcRegisterAddr
}

func (cli *K8sDR) AddOption(opts ...grpc.DialOption) {
cli.options = append(cli.options, opts...)
}

func (cli *K8sDR) CloseConn(conn *grpc.ClientConn) {
conn.Close()
}
Expand Down

0 comments on commit 49f4e3f

Please sign in to comment.