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 more hooks info to backup/restore CR #7154

Closed
allenxu404 opened this issue Nov 28, 2023 · 3 comments · Fixed by #7679
Closed

Add more hooks info to backup/restore CR #7154

allenxu404 opened this issue Nov 28, 2023 · 3 comments · Fixed by #7679

Comments

@allenxu404
Copy link
Contributor

Describe the problem/challenge you have
With the PR(#7117) merged, backup/restore CR has hooksAttempted and hooksFailed as two initial hook metadata. We could adding more hook info to backup/restore CR to help track the status of hooks.

Describe the solution you'd like
With the hooksTracker introduced in PR(#7117), we can track additional details like hook error information and skipped hooks.

Anything else you would like to add:

Environment:

  • Velero version (use velero version):
  • Kubernetes version (use kubectl version):
  • Kubernetes installer & version:
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):

Vote on this issue!

This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.

  • 👍 for "The project would be better with this feature added"
  • 👎 for "This feature will not enhance the project in a meaningful way"
@allenxu404
Copy link
Contributor Author

@anshulahuja98 After further review, I think it's best to leave the hook information as-is without adding separate fields for hook errors and skipped hooks:

As for hook errors, currently the information around hook errors are already captured in backup log and restore result and displayed prominently under Errors section in backup/restore describe output. Putting those errors again under the Hook status section may lead to repetitive data when viewing describe output.

As for skipped hooks, currently any hooks that are not eventually executed are counted as failed hooks and the detailed error messages are recorded to help user know they are skipped . Add a separate skipped hooks field could potentially confuse users because skipped hooks are already included in hooksFailed field.

err := fmt.Errorf("hook %s in container %s in pod %s not executed: %v", hook.HookName, hook.Hook.Container, kube.NamespaceAndName(pod), ctx.Err())

What's your thought?

@anshulahuja98
Copy link
Collaborator

That's seems fine for now.
Over time however we can look into improving the error logs related to hooks, anywhere we see discrepancy.

CC: @Shashank1306s to share if he has any thoughts.

@allenxu404
Copy link
Contributor Author

Over time however we can look into improving the error logs related to hooks, anywhere we see discrepancy.

Agreed.

I will modify the doc related to hooks to clarify the hook information we currently collect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment