queued disk stuff
Some checks are pending
Build and Publish / Metadata (push) Successful in 10s
Build and Publish / BuildAndDeployAmd64 (push) Has started running
Build and Publish / BuildAndDeployArm64 (push) Has started running

This commit is contained in:
matst80
2025-10-13 19:05:12 +02:00
parent 6fbd62936f
commit f3e92c7d65
6 changed files with 87 additions and 38 deletions

View File

@@ -2,6 +2,7 @@ package discovery
import (
"context"
"log"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -46,7 +47,7 @@ func (k *K8sDiscovery) Watch() (<-chan HostChange, error) {
TimeoutSeconds: &timeout,
})
}
watcher, err := toolsWatch.NewRetryWatcher("1", &cache.ListWatch{WatchFunc: watcherFn})
watcher, err := toolsWatch.NewRetryWatcherWithContext(k.ctx, "1", &cache.ListWatch{WatchFunc: watcherFn})
if err != nil {
return nil, err
}
@@ -55,6 +56,7 @@ func (k *K8sDiscovery) Watch() (<-chan HostChange, error) {
for event := range watcher.ResultChan() {
pod := event.Object.(*v1.Pod)
log.Printf("pod change %v", pod.Status)
ch <- HostChange{
Host: pod.Status.PodIP,
Type: event.Type,