Skip to content

Commit 15b68c4

Browse files
🐛 Fix single-use dialer already dialed issue (#458)
* Fix `single-use dialer already dialed` issue Signed-off-by: Rokibul Hasan <[email protected]> * Use `CreateSingleUseGrpcTunnelWithContext()` Signed-off-by: Rokibul Hasan <[email protected]> --------- Signed-off-by: Rokibul Hasan <[email protected]>
1 parent 198563c commit 15b68c4

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

pkg/cmd/proxy/health/exec.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,19 +148,20 @@ func (o *Options) run(streams genericiooptions.IOStreams) error {
148148
return errors.Wrapf(err, "failed building tls config")
149149
}
150150

151-
tunnel, err := konnectivity.CreateSingleUseGrpcTunnel(
152-
ctx,
153-
net.JoinHostPort(o.proxyServerHost, strconv.Itoa(o.proxyServerPort)),
154-
grpc.WithTransportCredentials(grpccredentials.NewTLS(tlsCfg)),
155-
)
156-
if err != nil {
157-
return errors.Wrapf(err, "failed starting konnectivity proxy")
158-
}
159-
160151
probingClusters := o.ClusterOption.AllClusters()
161152
w := newWriter(streams)
162153
for _, cluster := range managedClusterList.Items {
163154
if probingClusters.Len() == 0 || probingClusters.Has(cluster.Name) {
155+
tunnel, err := konnectivity.CreateSingleUseGrpcTunnelWithContext(
156+
context.TODO(),
157+
ctx,
158+
net.JoinHostPort(o.proxyServerHost, strconv.Itoa(o.proxyServerPort)),
159+
grpc.WithTransportCredentials(grpccredentials.NewTLS(tlsCfg)),
160+
)
161+
if err != nil {
162+
return errors.Wrapf(err, "failed starting konnectivity proxy")
163+
}
164+
164165
if err := o.visit(&w, hubRestConfig, addonClient, tunnel.DialContext, cluster.Name); err != nil {
165166
klog.Errorf("An error occurred when requesting: %v", err)
166167
}

0 commit comments

Comments
 (0)