Skip to content

Commit

Permalink
address the comment
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx committed Aug 31, 2023
1 parent 0bfbd0b commit 309aecc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkg/mcs/scheduling/server/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (

// Cluster is used to manage all information for scheduling purpose.
type Cluster struct {
ctx context.Context
*core.BasicCluster
persistConfig *config.PersistConfig
ruleManager *placement.RuleManager
Expand All @@ -45,6 +46,7 @@ func NewCluster(ctx context.Context, persistConfig *config.PersistConfig, storag
}
ruleManager := placement.NewRuleManager(storage, basicCluster, persistConfig)
c := &Cluster{
ctx: ctx,
BasicCluster: basicCluster,
ruleManager: ruleManager,
labelerManager: labelerManager,
Expand Down Expand Up @@ -146,7 +148,7 @@ func (c *Cluster) AllocID() (uint64, error) {
c.checkMembershipCh <- struct{}{}
return 0, errors.New("API server leader is not found")
}
resp, err := cli.AllocID(context.Background(), &pdpb.AllocIDRequest{Header: &pdpb.RequestHeader{ClusterId: c.clusterID}})
resp, err := cli.AllocID(c.ctx, &pdpb.AllocIDRequest{Header: &pdpb.RequestHeader{ClusterId: c.clusterID}})
if err != nil {
c.checkMembershipCh <- struct{}{}
return 0, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/mcs/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (bs *BaseServer) Context() context.Context {
return bs.ctx
}

// GetDelegateClient returns grpc client connection talking to the forwarded host
// GetDelegateClient returns grpc client connection talking to the forwarded host.
func (bs *BaseServer) GetDelegateClient(ctx context.Context, tlsCfg *grpcutil.TLSConfig, forwardedHost string) (*grpc.ClientConn, error) {
client, ok := bs.clientConns.Load(forwardedHost)
if !ok {
Expand Down

0 comments on commit 309aecc

Please sign in to comment.