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

Annotate PVC with host-assisted clone fallback reason; add missing events #2814

Merged

Conversation

arnongilboa
Copy link
Collaborator

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Release note:

Annotate PVC with host-assisted clone fallback reason; add missing events

@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. labels Jul 19, 2023
Log logr.Logger
TargetClaim *corev1.PersistentVolumeClaim
DataSource *cdiv1.VolumeCloneSource
FallbackReason string
Copy link
Member

@mhenriks mhenriks Jul 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to have ChooseStrategy return a struct that contains the strategy and fallbackreason

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like

type ChooseStrategyResult struct{
    Strategy cdiv1.CDICloneStrategy
    FallbackReason *string
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, smells better

@arnongilboa arnongilboa force-pushed the clone_fallback_reason_annotation branch from e17452b to c76b32c Compare July 20, 2023 11:11
@arnongilboa arnongilboa force-pushed the clone_fallback_reason_annotation branch from c76b32c to df5cf66 Compare July 20, 2023 11:17
@@ -48,6 +48,9 @@ const (
// AnnCloneError has the error string for error phase
AnnCloneError = "cdi.kubevirt.io/cloneError"

// AnnCloneFallbackReason has the host-assisted clone fallback reason
AnnCloneFallbackReason = "cdi.kubevirt.io/cloneFallbackReason"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataVolume controller should add this annotation when using non-csi clone path

Copy link
Member

@mhenriks mhenriks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no functional test possible?

// NoPopulator reports CDI populator is not used so we fallback to host-assisted cloning (reason)
NoPopulator = "NoPopulator"
// NoPopulatorMessage reports CDI populator is not used so we fallback to host-assisted cloning (message)
NoPopulatorMessage = "CDI populator is not used"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something like "in tree storage class does not support snapshot/clone" would be better

@arnongilboa arnongilboa force-pushed the clone_fallback_reason_annotation branch from 5dad228 to 25f2fad Compare July 24, 2023 17:38
and add missing events

Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
when DV controller is using the non-CSI clone path

Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
@arnongilboa arnongilboa force-pushed the clone_fallback_reason_annotation branch from 25f2fad to 99640a1 Compare July 26, 2023 11:14
@arnongilboa
Copy link
Collaborator Author

no functional test possible?

added

@kubevirt-bot
Copy link
Contributor

kubevirt-bot commented Jul 26, 2023

@arnongilboa: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cdi-verify-go-mod 99640a1 link false /test pull-cdi-verify-go-mod

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@mhenriks
Copy link
Member

/lgtm
/approve

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 26, 2023
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mhenriks

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 26, 2023
@kubevirt-bot kubevirt-bot merged commit 3c57d94 into kubevirt:main Jul 26, 2023
16 of 17 checks passed
@kubevirt-bot
Copy link
Contributor

@arnongilboa: #2814 failed to apply on top of branch "release-v1.56":

Applying: Annotate PVC with host-assisted clone fallback reason
Using index info to reconstruct a base tree...
A	pkg/controller/clone/planner.go
A	pkg/controller/clone/planner_test.go
A	pkg/controller/populators/clone-populator.go
A	pkg/controller/populators/clone-populator_test.go
Falling back to patching base and 3-way merge...
CONFLICT (modify/delete): pkg/controller/populators/clone-populator_test.go deleted in HEAD and modified in Annotate PVC with host-assisted clone fallback reason. Version Annotate PVC with host-assisted clone fallback reason of pkg/controller/populators/clone-populator_test.go left in tree.
CONFLICT (modify/delete): pkg/controller/populators/clone-populator.go deleted in HEAD and modified in Annotate PVC with host-assisted clone fallback reason. Version Annotate PVC with host-assisted clone fallback reason of pkg/controller/populators/clone-populator.go left in tree.
CONFLICT (modify/delete): pkg/controller/clone/planner_test.go deleted in HEAD and modified in Annotate PVC with host-assisted clone fallback reason. Version Annotate PVC with host-assisted clone fallback reason of pkg/controller/clone/planner_test.go left in tree.
CONFLICT (modify/delete): pkg/controller/clone/planner.go deleted in HEAD and modified in Annotate PVC with host-assisted clone fallback reason. Version Annotate PVC with host-assisted clone fallback reason of pkg/controller/clone/planner.go left in tree.
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Annotate PVC with host-assisted clone fallback reason
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-v1.56

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@arnongilboa
Copy link
Collaborator Author

/cherrypick release-v1.57

@kubevirt-bot
Copy link
Contributor

@arnongilboa: new pull request created: #2824

In response to this:

/cherrypick release-v1.57

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants