Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add logs for sync failture #9200

Open
ericzzzzzzz opened this issue Dec 1, 2023 · 0 comments
Open

add logs for sync failture #9200

ericzzzzzzz opened this issue Dec 1, 2023 · 0 comments

Comments

@ericzzzzzzz
Copy link
Contributor

  • To have a better understanding why file-sync fails, we need add more logs here
    for _, ns := range namespaces {
    pods, err := client.CoreV1().Pods(ns).List(ctx, metav1.ListOptions{})
    if err != nil {
    return fmt.Errorf("getting pods for namespace %q: %w", ns, err)
    }
    for _, p := range pods.Items {
    if p.Status.Phase != v1.PodRunning {
    continue
    }
    for _, c := range p.Spec.Containers {
    if c.Image != image {
    continue
    }
    cmd := cmdFn(ctx, p, c, files)
    errs.Go(func() error {
    _, err := util.RunCmdOut(ctx, cmd)
    return err
    })
    numSynced++
    }
    }
    }
  • What files we want to sync
  • What is the reason for skipping ? Pod is not running? Image mismatch?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant