Merge pull request #5452 from hulizhe/karmadactltoppod
enhance top pod command
This commit is contained in:
commit
ac20f41e41
|
@ -84,6 +84,12 @@ var (
|
|||
# Show metrics for all pods in the default namespace
|
||||
%[1]s top pod
|
||||
|
||||
# Show metrics for all pods in the default namespace in member1 cluster
|
||||
%[1]s top pod --clusters=member1
|
||||
|
||||
# Show metrics for all pods in the default namespace in member1 and member2 cluster
|
||||
%[1]s top pod --clusters=member1,member2
|
||||
|
||||
# Show metrics for all pods in the given namespace
|
||||
%[1]s top pod --namespace=NAMESPACE
|
||||
|
||||
|
|
|
@ -589,28 +589,30 @@ var _ = ginkgo.Describe("Karmadactl top testing", func() {
|
|||
})
|
||||
|
||||
ginkgo.It("Karmadactl top existing pod", func() {
|
||||
for _, clusterName := range framework.ClusterNames() {
|
||||
cmd := framework.NewKarmadactlCommand(kubeconfig, karmadaContext, karmadactlPath, pod.Namespace, karmadactlTimeout, "top", "pod", pod.Name, "-n", pod.Namespace, "-C", clusterName)
|
||||
ginkgo.By("Karmadactl top existing pod", func() {
|
||||
for _, clusterName := range framework.ClusterNames() {
|
||||
cmd := framework.NewKarmadactlCommand(kubeconfig, karmadaContext, karmadactlPath, pod.Namespace, karmadactlTimeout, "top", "pod", pod.Name, "-n", pod.Namespace, "-C", clusterName)
|
||||
_, err := cmd.ExecOrDie()
|
||||
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
|
||||
}
|
||||
})
|
||||
|
||||
ginkgo.By("Karmadactl top existing pod without setting cluster flag", func() {
|
||||
cmd := framework.NewKarmadactlCommand(kubeconfig, karmadaContext, karmadactlPath, pod.Namespace, karmadactlTimeout, "top", "pod", pod.Name, "-n", pod.Namespace)
|
||||
_, err := cmd.ExecOrDie()
|
||||
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
ginkgo.It("Karmadactl top existing pod without setting cluster flag", func() {
|
||||
cmd := framework.NewKarmadactlCommand(kubeconfig, karmadaContext, karmadactlPath, pod.Namespace, karmadactlTimeout, "top", "pod", pod.Name, "-n", pod.Namespace)
|
||||
_, err := cmd.ExecOrDie()
|
||||
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
|
||||
})
|
||||
|
||||
ginkgo.It("Karmadactl top pod without specific podName", func() {
|
||||
cmd := framework.NewKarmadactlCommand(kubeconfig, karmadaContext, karmadactlPath, pod.Namespace, karmadactlTimeout, "top", "pod", "-A")
|
||||
_, err := cmd.ExecOrDie()
|
||||
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
|
||||
for _, clusterName := range framework.ClusterNames() {
|
||||
cmd := framework.NewKarmadactlCommand(kubeconfig, karmadaContext, karmadactlPath, pod.Namespace, karmadactlTimeout, "top", "pod", "-A", "-C", clusterName)
|
||||
ginkgo.By("Karmadactl top pod without specific podName", func() {
|
||||
cmd := framework.NewKarmadactlCommand(kubeconfig, karmadaContext, karmadactlPath, pod.Namespace, karmadactlTimeout, "top", "pod", "-A")
|
||||
_, err := cmd.ExecOrDie()
|
||||
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
|
||||
}
|
||||
for _, clusterName := range framework.ClusterNames() {
|
||||
cmd := framework.NewKarmadactlCommand(kubeconfig, karmadaContext, karmadactlPath, pod.Namespace, karmadactlTimeout, "top", "pod", "-A", "-C", clusterName)
|
||||
_, err := cmd.ExecOrDie()
|
||||
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue