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

Allow ImmediateBinding annotation when using populators #2765

Merged
merged 4 commits into from
Jul 9, 2023

Conversation

ShellyKa13
Copy link
Contributor

In case of using PVC with populators if the PVC has this annotation we prevent from waiting for it to be schedueled and we proceed with the process.
When using datavolumes with populators in case the dv has the annotation it will be passed to the PVC. we prevent from being in pendingPopulation in case the created pvc has the annotaion.
Plus when having honorWaitForFirstConsumer feature gate disabled we will put on the target PVC the immediateBinding annotation. Now we allow to use populators when having the annotation the the feature gate disabled.

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:
Integration of clone datavolumes with populators is in a PR: #2750
once merged will need to add to the datavolume clone controller the ImmediateBinding annotation in case of honorWaitForFirstConsumer feature gate disabled

Release note:

Allow ImmediateBinding annotation when using populators

@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 Jun 21, 2023
}
if !globalHonorWaitForFirstConsumer {
cc.AddAnnotation(pvc, cc.AnnImmediateBinding, "")
}
Copy link
Member

Choose a reason for hiding this comment

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

Maybe put this code in a function that can be shared all the other controllers?

Copy link
Collaborator

@alromeros alromeros left a comment

Choose a reason for hiding this comment

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

The code looks good to me, do you plan to add more functional tests?

expectedPVCPhase = v1.ClaimPending
}
By(fmt.Sprintf("waiting for pvc to match phase %s", string(expectedPVCPhase)))
err = utils.WaitForPersistentVolumeClaimPhase(f.K8sClient, pvc.Namespace, expectedPVCPhase, pvc.Name)
Copy link
Member

Choose a reason for hiding this comment

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

I get that these existing DataVolume tests are implicitly testing "immediate bind on populators". May be helpful to have a couple explicit tests as well

@ShellyKa13
Copy link
Contributor Author

/hold
waiting to PR #2750 to be merged to add the clone controller part and test
@mhenriks @alromeros added functional test for import and upload for populators with pvc only, any other test you expected?

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 26, 2023
@mhenriks
Copy link
Member

/approve

@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 Jun 28, 2023
@awels
Copy link
Member

awels commented Jun 30, 2023

/retest-required
/hold cancel
required PR was merged.

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 30, 2023
@awels
Copy link
Member

awels commented Jun 30, 2023

/hold
Oops missed the we need some extra tests. putting hold back

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 30, 2023
In case of using PVC with populators if the PVC has this
annotation we prevent from waiting for it to be schedueled
and we proceed with the process.
When using datavolumes with populators in case the dv has the annotation
it will be passed to the PVC. we prevent from being in pendingPopulation
in case the created pvc has the annotaion.
Plus when having honorWaitForFirstConsumer feature gate disabled we will
put on the target PVC the immediateBind annotation.
Now we allow to use populators when having the annotation the the
feature gate disabled.

Signed-off-by: Shelly Kagan <skagan@redhat.com>
Signed-off-by: Shelly Kagan <skagan@redhat.com>
@ShellyKa13 ShellyKa13 force-pushed the populators-immediate-bind branch 2 times, most recently from 8fde694 to 1d4d715 Compare July 3, 2023 14:43
@ShellyKa13
Copy link
Contributor Author

/unhold
required PR was merged, added relevant code to clone populator and datavolume clone, added required tests

@kubevirt-bot kubevirt-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 3, 2023
@ShellyKa13
Copy link
Contributor Author

/retest

if targetStorageClass.VolumeBindingMode != nil &&
*targetStorageClass.VolumeBindingMode == storagev1.VolumeBindingWaitForFirstConsumer &&
cc.ImmediateBindingRequested(args.TargetClaim) {
args.Log.V(3).Info("Immediate binding requested, need to fall back to host assisted")
Copy link
Member

Choose a reason for hiding this comment

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

This should not be necessary. The prep phase can bind pvc' to a random node.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

you mean leave without the fallback and create the pvc' without waiting for selected node and it will just get bound with the pod of the clone? or need to implement something for that?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah shouldn't have to make any changes to the planner

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Signed-off-by: Shelly Kagan <skagan@redhat.com>
@mhenriks
Copy link
Member

mhenriks commented Jul 6, 2023

/test pull-containerized-data-importer-e2e-istio

@mhenriks
Copy link
Member

mhenriks commented Jul 6, 2023

/lgtm

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

mhenriks commented Jul 6, 2023

/test pull-cdi-apidocs

@alromeros
Copy link
Collaborator

/lgtm
/test pull-containerized-data-importer-e2e-istio

@awels
Copy link
Member

awels commented Jul 7, 2023

/test pull-containerized-data-importer-e2e-istio

1 similar comment
@awels
Copy link
Member

awels commented Jul 7, 2023

/test pull-containerized-data-importer-e2e-istio

@awels
Copy link
Member

awels commented Jul 7, 2023

I think this might be a real failure, if you look at the 1_dv logs file, you will see the DV in state pending while we are waiting for the WFFC or population pending state.

@akalenyu
Copy link
Collaborator

akalenyu commented Jul 9, 2023

I think this might be a real failure, if you look at the 1_dv logs file, you will see the DV in state pending while we are waiting for the WFFC or population pending state.

Yeah I think this is the same one I am handling in #2784

This annotations are used for the import/upload/clone
pods to define netork configurations.

Signed-off-by: Shelly Kagan <skagan@redhat.com>
@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 9, 2023
@awels
Copy link
Member

awels commented Jul 9, 2023

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Jul 9, 2023
@kubevirt-bot kubevirt-bot merged commit 533a725 into kubevirt:main Jul 9, 2023
@awels
Copy link
Member

awels commented Jul 9, 2023

/hold

@kubevirt-bot kubevirt-bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 9, 2023
@ShellyKa13
Copy link
Contributor Author

/cherrypick release-v1.57

@kubevirt-bot
Copy link
Contributor

@ShellyKa13: new pull request created: #2793

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.

@awels
Copy link
Member

awels commented Jul 10, 2023

oh I was too slow with the hold, I thought there were some questions remaining

@ShellyKa13
Copy link
Contributor Author

@awels yeah :) never mind, I did the cherry pick so if we decide that its ok we can get the backport in faster and do the release.
But we will talk in grooming and see if we should create a fixup PR

akalenyu added a commit to akalenyu/containerized-data-importer that referenced this pull request Sep 21, 2023
I find myself going back a lot to this function and I noticed
some of the fallback reasons are outdated following:
kubevirt#2765
kubevirt#2873

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
akalenyu added a commit to akalenyu/containerized-data-importer that referenced this pull request Sep 26, 2023
I find myself going back a lot to this function and I noticed
some of the fallback reasons are outdated following:
kubevirt#2765
kubevirt#2873

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
kubevirt-bot pushed a commit that referenced this pull request Sep 26, 2023
I find myself going back a lot to this function and I noticed
some of the fallback reasons are outdated following:
#2765
#2873

Signed-off-by: Alex Kalenyuk <akalenyu@redhat.com>
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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. 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.

6 participants