refactor: refactor cmd status (#236)

Co-authored-by: wencaiwulue <895703375@qq.com>
This commit is contained in:
naison
2024-04-30 22:02:48 +08:00
committed by GitHub
parent 706afb348d
commit ca18dab08f
13 changed files with 1336 additions and 397 deletions

View File

@@ -109,7 +109,7 @@ func (option *Options) Main(ctx context.Context, c *containerConfig) error {
return sort.Reverse(podutils.ActivePods(pods))
}
label := labels.SelectorFromSet(templateSpec.Labels).String()
firstPod, _, err := polymorphichelpers.GetFirstPod(clientSet.CoreV1(), option.Namespace, label, time.Second*60, sortBy)
firstPod, _, err := polymorphichelpers.GetFirstPod(clientSet.CoreV1(), option.Namespace, label, time.Second*5, sortBy)
if err != nil {
log.Errorf("get first running pod from k8s: %v", err)
return err