grpc: move to use grpc.WithTransportCredentials()

v1.43.0 marked grpc.WithInsecure() deprecated so this commit moves to use
what is the recommended replacement:

grpc.WithTransportCredentials(insecure.NewCredentials())

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
This commit is contained in:
Mikko Ylinen
2022-05-11 12:13:28 +03:00
parent 7e3c98fd30
commit 2c8bfad910
11 changed files with 44 additions and 12 deletions

View File

@@ -24,6 +24,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials/insecure"
grpchealth "google.golang.org/grpc/health/grpc_health_v1"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
@@ -55,7 +56,7 @@ func (p grpcProber) Probe(host, service string, port int, timeout time.Duration)
opts := []grpc.DialOption{
grpc.WithUserAgent(fmt.Sprintf("kube-probe/%s.%s", v.Major, v.Minor)),
grpc.WithBlock(),
grpc.WithInsecure(), //credentials are currently not supported
grpc.WithTransportCredentials(insecure.NewCredentials()), //credentials are currently not supported
}
ctx, cancel := context.WithTimeout(context.Background(), timeout)