Skip to content

Commit ab915b6

Browse files
committed
Fix single-use dialer already dialed issue
Signed-off-by: Rokibul Hasan <[email protected]>
1 parent 198563c commit ab915b6

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

pkg/cmd/proxy/health/exec.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,19 +148,19 @@ 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.CreateSingleUseGrpcTunnel(
156+
ctx,
157+
net.JoinHostPort(o.proxyServerHost, strconv.Itoa(o.proxyServerPort)),
158+
grpc.WithTransportCredentials(grpccredentials.NewTLS(tlsCfg)),
159+
)
160+
if err != nil {
161+
return errors.Wrapf(err, "failed starting konnectivity proxy")
162+
}
163+
164164
if err := o.visit(&w, hubRestConfig, addonClient, tunnel.DialContext, cluster.Name); err != nil {
165165
klog.Errorf("An error occurred when requesting: %v", err)
166166
}

0 commit comments

Comments
 (0)