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

Added ItemBlockAction plugin and example test data #74

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sseago
Copy link
Collaborator

@sseago sseago commented Sep 13, 2024

This PR adds an ItemBlockAction plugin as part of the documentation effort for the new Velero 1.15 plugin type.

The test data in examples/itemblock-pods.yaml will create two deployments whose pods will be included in a single ItemBlock -- this can be seen in the backup logs by looking at the order of the pre and post hooks which are defined in the test data. Without a shared ItemBlock, you would see logging for pre and post hook for pod1, followed by logging for pre and post hook of pod2. With the ItemBlock defined as specified in the example plugin, you will see both pre hooks run, followed by backing up the pods (and associated volumes, etc.), followed by both post hooks.

...
time="2024-09-13T16:08:25Z" level=info msg="running exec hook" backup=openshift-adp/itemblock-test1 hookCommand="[/usr/bin/echo pre-hook]" hookContainer=nginx hookName="<from-annotation>" hookOnError=Fail hookPhase=pre hookSource=annotati
on hookTimeout="{30s}" hookType=exec logSource="pkg/podexec/pod_command_executor.go:133"
time="2024-09-13T16:08:25Z" level=info msg="stdout: pre-hook\n" backup=openshift-adp/itemblock-test1 hookCommand="[/usr/bin/echo pre-hook]" hookContainer=nginx hookName="<from-annotation>" hookOnError=Fail hookPhase=pre hookSource=annotat
ion hookTimeout="{30s}" hookType=exec logSource="pkg/podexec/pod_command_executor.go:180"
time="2024-09-13T16:08:25Z" level=info msg="stderr: " backup=openshift-adp/itemblock-test1 hookCommand="[/usr/bin/echo pre-hook]" hookContainer=nginx hookName="<from-annotation>" hookOnError=Fail hookPhase=pre hookSource=annotation hookTi
meout="{30s}" hookType=exec logSource="pkg/podexec/pod_command_executor.go:181"
time="2024-09-13T16:08:25Z" level=info msg="running exec hook" backup=openshift-adp/itemblock-test1 hookCommand="[/usr/bin/echo pre-hook]" hookContainer=nginx hookName="<from-annotation>" hookOnError=Fail hookPhase=pre hookSource=annotati
on hookTimeout="{30s}" hookType=exec logSource="pkg/podexec/pod_command_executor.go:133"
time="2024-09-13T16:08:25Z" level=info msg="stdout: pre-hook\n" backup=openshift-adp/itemblock-test1 hookCommand="[/usr/bin/echo pre-hook]" hookContainer=nginx hookName="<from-annotation>" hookOnError=Fail hookPhase=pre hookSource=annotat
ion hookTimeout="{30s}" hookType=exec logSource="pkg/podexec/pod_command_executor.go:180"
time="2024-09-13T16:08:25Z" level=info msg="stderr: " backup=openshift-adp/itemblock-test1 hookCommand="[/usr/bin/echo pre-hook]" hookContainer=nginx hookName="<from-annotation>" hookOnError=Fail hookPhase=pre hookSource=annotation hookTi
meout="{30s}" hookType=exec logSource="pkg/podexec/pod_command_executor.go:181"
...
time="2024-09-13T16:08:25Z" level=info msg="Backing up item" backup=openshift-adp/itemblock-test1 logSource="pkg/backup/item_backupper.go:184" name=nginx-deployment1-5b7c7c5976-78fqb namespace=nginx-itemblock resource=pods
...
time="2024-09-13T16:08:31Z" level=info msg="Backing up item" backup=openshift-adp/itemblock-test1 logSource="pkg/backup/item_backupper.go:184" name=nginx-deployment2-5fc75b6774-7knd7 namespace=nginx-itemblock resource=pods
...
time="2024-09-13T16:08:36Z" level=info msg="running exec hook" backup=openshift-adp/itemblock-test1 hookCommand="[/usr/bin/echo post-hook]" hookContainer=nginx hookName="<from-annotation>" hookOnError=Fail hookPhase=post hookSource=annotation hookTimeout="{30s}" hookType=exec logSource="pkg/podexec/pod_command_executor.go:133"
time="2024-09-13T16:08:36Z" level=info msg="stdout: post-hook\n" backup=openshift-adp/itemblock-test1 hookCommand="[/usr/bin/echo post-hook]" hookContainer=nginx hookName="<from-annotation>" hookOnError=Fail hookPhase=post hookSource=annotation hookTimeout="{30s}" hookType=exec logSource="pkg/podexec/pod_command_executor.go:180"
time="2024-09-13T16:08:36Z" level=info msg="stderr: " backup=openshift-adp/itemblock-test1 hookCommand="[/usr/bin/echo post-hook]" hookContainer=nginx hookName="<from-annotation>" hookOnError=Fail hookPhase=post hookSource=annotation hookTimeout="{30s}" hookType=exec logSource="pkg/podexec/pod_command_executor.go:181"
time="2024-09-13T16:08:36Z" level=info msg="running exec hook" backup=openshift-adp/itemblock-test1 hookCommand="[/usr/bin/echo post-hook]" hookContainer=nginx hookName="<from-annotation>" hookOnError=Fail hookPhase=post hookSource=annotation hookTimeout="{30s}" hookType=exec logSource="pkg/podexec/pod_command_executor.go:133"
time="2024-09-13T16:08:36Z" level=info msg="stdout: post-hook\n" backup=openshift-adp/itemblock-test1 hookCommand="[/usr/bin/echo post-hook]" hookContainer=nginx hookName="<from-annotation>" hookOnError=Fail hookPhase=post hookSource=annotation hookTimeout="{30s}" hookType=exec logSource="pkg/podexec/pod_command_executor.go:180"
time="2024-09-13T16:08:36Z" level=info msg="stderr: " backup=openshift-adp/itemblock-test1 hookCommand="[/usr/bin/echo post-hook]" hookContainer=nginx hookName="<from-annotation>" hookOnError=Fail hookPhase=post hookSource=annotation hookTimeout="{30s}" hookType=exec logSource="pkg/podexec/pod_command_executor.go:181"

Signed-off-by: Scott Seago <sseago@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant