Skip to content

Commit

Permalink
Fix get work filter and return more details (#326)
Browse files Browse the repository at this point in the history
Signed-off-by: Jian Qiu <[email protected]>
  • Loading branch information
qiujian16 authored Mar 28, 2023
1 parent a98dfd3 commit 17dfd72
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/cmd/get/work/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (o *Options) run() (err error) {
workList, err = workClient.WorkV1().ManifestWorks(o.cluster).List(context.TODO(), metav1.ListOptions{})
} else {
workList, err = workClient.WorkV1().ManifestWorks(o.cluster).List(context.TODO(), metav1.ListOptions{
FieldSelector: fmt.Sprintf("name=%s", o.workName),
FieldSelector: fmt.Sprintf("metadata.name=%s", o.workName),
})
}
if err != nil {
Expand All @@ -92,8 +92,9 @@ func (o *Options) convertToTree(obj runtime.Object, tree *printer.TreePrinter) *
mp[".Number of Manifests"] = number
mp[".Applied"] = applied
mp[".Available"] = available

tree.AddFileds(work.Name, &mp)
workStatus := printer.WorkDetails(".Resources", &work)
tree.AddFileds(work.Name, &workStatus)
}
}
return tree
Expand Down

0 comments on commit 17dfd72

Please sign in to comment.