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

Ensure priority class is assigned to pod populating pvc prime #2864

Merged
merged 4 commits into from
Aug 25, 2023

Conversation

awels
Copy link
Member

@awels awels commented Aug 23, 2023

What this PR does / why we need it:
Priority class was not being passed to the pvc prime from the PVC and thus was not being added to the importer pod populating the pvc prime. There is a list of allowed annotations that can be passed and the priority class annotation was not in it. This commit adds the annotation to the allowed list.

Cleaned up unneeded log argument to a function related to passing the annotations.

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 RHBZ: 2231839

Special notes for your reviewer:

Release note:

BugFix: Fix not passing priority class to populator pod

Priority class was not being passed to the pvc prime from the PVC
and thus was not being added to the importer pod populating the
pvc prime. There is a list of allowed annotations that can be passed
and the priority class annotation was not in it. This commit adds
the annotation to the allowed list.

Cleaned up unneed log argument to a function related to passing the
annotations.

Signed-off-by: Alexander Wels <awels@redhat.com>
@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 Aug 23, 2023
@akalenyu
Copy link
Collaborator

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akalenyu

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 Aug 23, 2023
@@ -259,7 +259,7 @@ func (r *ReconcilerBase) reconcile(req reconcile.Request, populator populatorCon

// We first perform the common reconcile steps.
// We should only continue if we get a valid PVC'
pvcPrime, err := r.reconcileCommon(pvc, populator, log)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we remove the log passed to reconcile too? I don't remember if I added this for some reason or just by mistake.

Copy link
Member Author

Choose a reason for hiding this comment

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

So I just checked, and the log passed in has a WithValues so it might actually make sense to keep everything due to that. The log will contain the PVC name and namespace in the log line.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah that's it, I think we should keep it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Lets see if we can make it clearer this is the case otherwise I will do this again. I was like why are we passing this log, the struct has a logger.

as the log message. Modified the name to make it clearer
this is the case.

Signed-off-by: Alexander Wels <awels@redhat.com>
@akalenyu
Copy link
Collaborator

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

@@ -3006,7 +3006,6 @@ var _ = Describe("[vendor:cnv-qe@redhat.com][level:component]DataVolume tests",
dataVolume := utils.NewDataVolumeWithHTTPImport(dataVolumeName, "1Gi", fmt.Sprintf(utils.TinyCoreQcow2URLRateLimit, f.CdiInstallNs))
By(fmt.Sprintf("creating new datavolume %s with priority class", dataVolume.Name))
dataVolume.Spec.PriorityClassName = "system-cluster-critical"
dataVolume.Annotations[controller.AnnPodRetainAfterCompletion] = "true"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe remove the annotation from the next two (upload and clone) tests? Other than that looks good to me.

Copy link
Member Author

Choose a reason for hiding this comment

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

So the cloner is problematic, as that pod disappears too quickly and the test fails..

because the pod disappears too quickly without retain

Signed-off-by: Alexander Wels <awels@redhat.com>
@alromeros
Copy link
Collaborator

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 23, 2023
@awels
Copy link
Member Author

awels commented Aug 23, 2023

/hold
Adding some unit tests for the upload and clone cases as well.

@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 Aug 23, 2023
Signed-off-by: Alexander Wels <awels@redhat.com>
@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label Aug 23, 2023
@awels
Copy link
Member Author

awels commented Aug 23, 2023

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

@alromeros
Copy link
Collaborator

/lgtm

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Aug 24, 2023
@awels
Copy link
Member Author

awels commented Aug 24, 2023

/hold cancel

@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 Aug 24, 2023
@awels
Copy link
Member Author

awels commented Aug 24, 2023

/cherrypick release-v1.57

@kubevirt-bot
Copy link
Contributor

@awels: once the present PR merges, I will cherry-pick it on top of release-v1.57 in a new PR and assign it to you.

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 Author

awels commented Aug 24, 2023

/test pull-containerized-data-importer-e2e-hpp-previous

@kubevirt-bot kubevirt-bot merged commit 2b8c425 into kubevirt:main Aug 25, 2023
16 of 18 checks passed
@kubevirt-bot
Copy link
Contributor

@awels: new pull request created: #2870

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 added a commit to awels/containerized-data-importer that referenced this pull request Aug 25, 2023
…rt#2864)

* Ensure priority class is assigned to pod populating pvc prime

Priority class was not being passed to the pvc prime from the PVC
and thus was not being added to the importer pod populating the
pvc prime. There is a list of allowed annotations that can be passed
and the priority class annotation was not in it. This commit adds
the annotation to the allowed list.

Cleaned up unneed log argument to a function related to passing the
annotations.

Signed-off-by: Alexander Wels <awels@redhat.com>

* Restore the logger as it was logging the pvc name as well
as the log message. Modified the name to make it clearer
this is the case.

Signed-off-by: Alexander Wels <awels@redhat.com>

* Have upload also use the populator, can't do clone
because the pod disappears too quickly without retain

Signed-off-by: Alexander Wels <awels@redhat.com>

* Test for priority class in upload as well as fix typo in cloning test.

Signed-off-by: Alexander Wels <awels@redhat.com>

---------

Signed-off-by: Alexander Wels <awels@redhat.com>
kubevirt-bot pushed a commit that referenced this pull request Aug 25, 2023
…vc prime (#2872)

* Ensure priority class is assigned to pod populating pvc prime (#2864)

* Ensure priority class is assigned to pod populating pvc prime

Priority class was not being passed to the pvc prime from the PVC
and thus was not being added to the importer pod populating the
pvc prime. There is a list of allowed annotations that can be passed
and the priority class annotation was not in it. This commit adds
the annotation to the allowed list.

Cleaned up unneed log argument to a function related to passing the
annotations.

Signed-off-by: Alexander Wels <awels@redhat.com>

* Restore the logger as it was logging the pvc name as well
as the log message. Modified the name to make it clearer
this is the case.

Signed-off-by: Alexander Wels <awels@redhat.com>

* Have upload also use the populator, can't do clone
because the pod disappears too quickly without retain

Signed-off-by: Alexander Wels <awels@redhat.com>

* Test for priority class in upload as well as fix typo in cloning test.

Signed-off-by: Alexander Wels <awels@redhat.com>

---------

Signed-off-by: Alexander Wels <awels@redhat.com>

* Use table import due to 1.57 using ginkgo v1

Signed-off-by: Alexander Wels <awels@redhat.com>

---------

Signed-off-by: Alexander Wels <awels@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. 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/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants