refact(pkg): Removes unused import, variables and functions. (#321)

Signed-off-by: Rahul Grover <rahulgrover99@gmail.com>
This commit is contained in:
Rahul Grover 2021-05-04 19:57:41 +05:30 committed by GitHub
parent 0e6a02ea74
commit a8376796b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 10 additions and 36 deletions

View file

@ -41,7 +41,7 @@ func parseEndpoint(ep string) (string, string, error) {
return s[0], s[1], nil
}
}
return "", "", fmt.Errorf("Invalid endpoint: %v", ep)
return "", "", fmt.Errorf("invalid endpoint: %v", ep)
}
//filters if the logd are informative or pollutant
@ -68,13 +68,13 @@ func isInfotrmativeLog(info string) bool {
func logGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
log := isInfotrmativeLog(info.FullMethod)
if log == true {
if log {
klog.Infof("GRPC call: %s requests %s", info.FullMethod, protosanitizer.StripSecrets(req))
}
resp, err := handler(ctx, req)
if log == true {
if log {
if err != nil {
klog.Errorf("GRPC error: %v", err)
} else {
@ -127,7 +127,6 @@ func (s *nonBlockingGRPCServer) Start() {
go s.serve(s.endpoint, s.idntyServer, s.ctrlServer, s.agentServer)
return
}
// Wait for the service to stop