From: SuperQ Date: Sat, 22 Jan 2022 16:26:26 +0000 (+0100) Subject: Fix up deprecated grpc.WithInsecure() X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=8211bed6a08bb114471cc7daebed56305354c4c8;p=blackbox_exporter.git Fix up deprecated grpc.WithInsecure() Signed-off-by: SuperQ --- diff --git a/prober/grpc.go b/prober/grpc.go index c528597..dc616ff 100644 --- a/prober/grpc.go +++ b/prober/grpc.go @@ -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" }