We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b029126 commit db893d8Copy full SHA for db893d8
client/cmd/backup.go
@@ -93,13 +93,14 @@ func showItem(name string, pvcName string) {
93
}
94
95
//print the database pod if it exists
96
- var pod *v1.Pod
97
- pod, err = Clientset.Core().Pods(api.NamespaceDefault).Get(name)
98
- if err != nil {
+ lo = v1.ListOptions{LabelSelector: "name=" + name}
+ log.Debug("label selector is " + lo.LabelSelector)
+ dbpods, err := Clientset.Core().Pods(api.NamespaceDefault).List(lo)
99
+ if err != nil || len(dbpods.Items) == 0{
100
fmt.Printf("\ndatabase pod %s\n", name+" is not found")
101
fmt.Println(err.Error())
102
} else {
- fmt.Printf("\ndatabase pod %s\n", pod.Name+" is found")
103
+ fmt.Printf("\ndatabase pod %s\n", name+" is found")
104
105
106
fmt.Println("")
0 commit comments