Skip to content

Commit c90f542

Browse files
authored
Merge pull request #32 from cybozu-go/regardless-of-pod-status
Allow profile collection regardless of pod status
2 parents 129446a + f0ea703 commit c90f542

1 file changed

Lines changed: 0 additions & 15 deletions

File tree

cmd/necoperf-cli/cmd/profile.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ package cmd
22

33
import (
44
"context"
5-
"fmt"
65
"log/slog"
76
"os"
87
"path/filepath"
98
"time"
109

1110
"github.com/cybozu-go/necoperf/internal/client"
1211
"github.com/spf13/cobra"
13-
corev1 "k8s.io/api/core/v1"
1412
)
1513

1614
var config struct {
@@ -22,16 +20,6 @@ var config struct {
2220
timeout time.Duration
2321
}
2422

25-
func isPodReady(pod *corev1.Pod) bool {
26-
for _, cond := range pod.Status.Conditions {
27-
if cond.Type != corev1.PodReady {
28-
continue
29-
}
30-
return cond.Status == corev1.ConditionTrue
31-
}
32-
return false
33-
}
34-
3523
func NewProfileCommand() *cobra.Command {
3624
cmd := &cobra.Command{
3725
Use: "profile",
@@ -59,9 +47,6 @@ func NewProfileCommand() *cobra.Command {
5947
if err != nil {
6048
return err
6149
}
62-
if !isPodReady(pod) {
63-
return fmt.Errorf("pod %s is not ready", pod.Name)
64-
}
6550
containerID, err := ds.GetContainerID(pod, config.containerName)
6651
if err != nil {
6752
return err

0 commit comments

Comments
 (0)