Skip to content

Commit 0615131

Browse files
committed
fix: add labels to the list
1 parent 8eed090 commit 0615131

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/run.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ func Run(ctx context.Context, group, namespace, labels string, hostPortOffset in
9393
gvkToResourceType[gvk] = resource.Name
9494

9595
// get the latest resource version
96-
list, err := dynamicClient.Resource(gvr).Namespace(namespace).List(ctx, metav1.ListOptions{})
96+
list, err := dynamicClient.Resource(gvr).Namespace(namespace).List(ctx, metav1.ListOptions{
97+
LabelSelector: labels,
98+
})
9799
if err != nil {
98100
return err
99101
}
@@ -248,7 +250,7 @@ func Run(ctx context.Context, group, namespace, labels string, hostPortOffset in
248250

249251
go func() {
250252
<-readyChan
251-
// pod might get deleted, check open and close socket every 1s
253+
// pod might get deleted, check open and close socket every few seconds
252254
ticker := time.NewTicker(5 * time.Second)
253255
defer ticker.Stop()
254256
for {

0 commit comments

Comments
 (0)