metropolis/cli/dbg: replace deprecated grpc.WithInsecure
Change-Id: I288446fa4055ee95ae024b634228afbae633dede
Reviewed-on: https://review.monogon.dev/c/monogon/+/3017
Vouch-Run-CI: Tim Windelschmidt <tim@monogon.tech>
Reviewed-by: Serge Bazanski <serge@monogon.tech>
Tested-by: Jenkins CI
diff --git a/metropolis/cli/dbg/BUILD.bazel b/metropolis/cli/dbg/BUILD.bazel
index 5991f63..46ac991 100644
--- a/metropolis/cli/dbg/BUILD.bazel
+++ b/metropolis/cli/dbg/BUILD.bazel
@@ -15,6 +15,7 @@
"@io_k8s_kubectl//pkg/cmd/plugin",
"@io_k8s_kubectl//pkg/cmd/util",
"@org_golang_google_grpc//:go_default_library",
+ "@org_golang_google_grpc//credentials/insecure",
],
)
diff --git a/metropolis/cli/dbg/main.go b/metropolis/cli/dbg/main.go
index e702083..f087313 100644
--- a/metropolis/cli/dbg/main.go
+++ b/metropolis/cli/dbg/main.go
@@ -25,6 +25,7 @@
"strings"
"google.golang.org/grpc"
+ "google.golang.org/grpc/credentials/insecure"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/component-base/cli"
"k8s.io/kubectl/pkg/cmd"
@@ -41,7 +42,7 @@
ctx := context.Background()
// Hardcode localhost since this should never be used to interface with a
// production node because of missing encryption & authentication
- grpcClient, err := grpc.Dial("localhost:7837", grpc.WithInsecure())
+ grpcClient, err := grpc.Dial("localhost:7837", grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
fmt.Printf("Failed to dial debug service (is it running): %v\n", err)
}