Skip to content

Commit

Permalink
add more logs
Browse files Browse the repository at this point in the history
  • Loading branch information
lghinet committed Dec 8, 2023
1 parent 9770062 commit d4cc58a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
30 changes: 15 additions & 15 deletions pkg/operator/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ import (
)

func newClient(ctx context.Context, address string) (operatorv1.RusiOperatorClient, error) {
//var retryPolicy = `{
// "methodConfig": [{
// "name": [{"service": "rusi.proto.operator.v1.RusiOperator"}],
// "waitForReady": true,
// "retryPolicy": {
// "MaxAttempts": 4,
// "InitialBackoff": ".01s",
// "MaxBackoff": ".01s",
// "BackoffMultiplier": 1.0,
// "RetryableStatusCodes": [ "UNAVAILABLE" ]
// }
// }]}`
var retryPolicy = `{
"methodConfig": [{
"name": [{"service": "rusi.proto.operator.v1.RusiOperator"}],
"waitForReady": true,
"retryPolicy": {
"MaxAttempts": 4,
"InitialBackoff": ".01s",
"MaxBackoff": ".01s",
"BackoffMultiplier": 1.0,
"RetryableStatusCodes": [ "UNAVAILABLE" ]
}
}]}`

//conn, err = grpc.DialContext(ctx, address, grpc.WithInsecure(), grpc.WithDefaultServiceConfig(retryPolicy))

conn, conErr := grpc.DialContext(ctx, address, grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, conErr := grpc.DialContext(ctx, address,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithDefaultServiceConfig(retryPolicy))
if conErr != nil {
return nil, conErr
}
Expand Down
5 changes: 0 additions & 5 deletions pkg/operator/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,10 @@ func (opsrv *operatorServer) WatchConfiguration(request *operatorv1.WatchConfigu
}

func (opsrv *operatorServer) WatchComponents(request *operatorv1.WatchComponentsRequest, stream operatorv1.RusiOperator_WatchComponentsServer) error {

klog.V(4).InfoS("Starting streaming components")

c := make(chan rusiv1.Component)
opsrv.ow.addComponentListener(c)
defer opsrv.ow.removeComponentListener(c)

klog.V(4).InfoS("Starting consuming components channel")

for {
select {
case obj := <-c:
Expand Down

0 comments on commit d4cc58a

Please sign in to comment.