Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Future-Outlier <[email protected]>
  • Loading branch information
Future-Outlier committed Jan 10, 2025
1 parent 6a30bd6 commit 4796e96
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions flytestdlib/resolver/k8s_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,14 @@ func (k *kResolver) resolve(e *v1.Endpoints) {
func (k *kResolver) run() {
k.wg.Add(1)
defer k.wg.Done()
logger.Infof(k.ctx, "Starting k8s resolver for target: %s", k.target)

logger.Infof(k.ctx, "Starting k8s resolver for target: [%s], service namespace: [%s], service name: [%s]", k.target, k.target.serviceNamespace, k.target.serviceName)

watcher, err := k.k8sClient.CoreV1().Endpoints(k.target.serviceNamespace).Watch(k.ctx, metav1.ListOptions{FieldSelector: "metadata.name=" + k.target.serviceName})
if err != nil {
logger.Errorf(
k.ctx,
"k8s resolver: failed to create watcher for target [%s]: namespace [%s], service [%s], error [%v]",
"k8s resolver: failed to create watcher for target [%s]: service namespace: [%s], service name: [%s], "+"error [%v]",
k.target, k.target.serviceNamespace, k.target.serviceName, err,
)
if statusErr, ok := err.(*errors.StatusError); ok {
Expand All @@ -177,11 +179,7 @@ func (k *kResolver) run() {
case <-k.ctx.Done():
return
case event, ok := <-watcher.ResultChan():
logger.Info(k.ctx, "k8s resolver watchet event response: [%v]", event)
logger.Info(k.ctx, "k8s resolver watchet event Object response: [%v]", event.Object)
if event.Object != nil {
logger.Info(k.ctx, "k8s resolver watchet event Object Kind: [%v]", event.Object.GetObjectKind())
}
logger.Info(k.ctx, "k8s resolver watcher event response: [%v]", event)
if !ok {
logger.Debugf(k.ctx, "k8s resolver: watcher closed")
return
Expand Down

0 comments on commit 4796e96

Please sign in to comment.