Skip to content

Commit 0b57b26

Browse files
committed
lint codes
Signed-off-by: Yeh-lei Wu <rayingecho@gmail.com>
1 parent d1ed32c commit 0b57b26

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pkg/plugin/cmd.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import (
1313
"k8s.io/apimachinery/pkg/util/uuid"
1414
"k8s.io/cli-runtime/pkg/genericclioptions"
1515
"k8s.io/client-go/kubernetes"
16-
"k8s.io/client-go/tools/watch"
1716
coreclient "k8s.io/client-go/kubernetes/typed/core/v1"
1817
restclient "k8s.io/client-go/rest"
1918
"k8s.io/client-go/tools/remotecommand"
19+
"k8s.io/client-go/tools/watch"
2020
"k8s.io/kubernetes/pkg/client/conditions"
2121
"k8s.io/kubernetes/pkg/util/interrupt"
2222
"log"
@@ -222,8 +222,11 @@ func (o *DebugOptions) Run() error {
222222
return err
223223
}
224224
watcher, err := o.CoreClient.Pods(pod.Namespace).Watch(v1.SingleObject(pod.ObjectMeta))
225+
if err != nil {
226+
return err
227+
}
225228
// FIXME: hard code -> config
226-
ctx, cancel := context.WithTimeout(context.Background(), 5 * time.Minute)
229+
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
227230
defer cancel()
228231
log.Println("waiting for forked container running...")
229232
event, err := watch.UntilWithoutRetry(ctx, watcher, conditions.PodRunning)
@@ -284,7 +287,7 @@ func (o *DebugOptions) Run() error {
284287
log.Printf("failed to delete pod %s, consider manual deletion.", pod.Name)
285288
}
286289
}
287-
}).Run(fn);
290+
}).Run(fn)
288291
}
289292

290293
if err := t.Safe(withCleanUp); err != nil {
@@ -379,4 +382,3 @@ func copyAndStripPod(pod *corev1.Pod, targetContainer string) *corev1.Pod {
379382

380383
return copied
381384
}
382-

0 commit comments

Comments
 (0)