Fix up deprecated grpc.WithInsecure()
authorSuperQ <superq@gmail.com>
Sat, 22 Jan 2022 16:26:26 +0000 (17:26 +0100)
committerSuperQ <superq@gmail.com>
Sat, 22 Jan 2022 16:26:26 +0000 (17:26 +0100)
Signed-off-by: SuperQ <superq@gmail.com>
prober/grpc.go

index c528597a8db12689336d1ce587ead09323d877a6..dc616ff22cbe4f18953aa610966cc1e44d0df738 100644 (file)
@@ -23,6 +23,7 @@ import (
        "google.golang.org/grpc"
        "google.golang.org/grpc/codes"
        "google.golang.org/grpc/credentials"
+       "google.golang.org/grpc/credentials/insecure"
        "google.golang.org/grpc/health/grpc_health_v1"
        "google.golang.org/grpc/peer"
        "google.golang.org/grpc/status"
@@ -165,7 +166,7 @@ func ProbeGRPC(ctx context.Context, target string, module config.Module, registr
        target = targetHost + ":" + targetPort
        if !module.GRPC.TLS {
                level.Debug(logger).Log("msg", "Dialing GRPC without TLS")
-               opts = append(opts, grpc.WithInsecure())
+               opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials()))
                if len(targetPort) == 0 {
                        target = targetHost + ":80"
                }