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

Propagate CDI workload NodePlacement to DIC CronJob and initial Job #2712

Merged
merged 1 commit into from
May 18, 2023

Conversation

arnongilboa
Copy link
Collaborator

@arnongilboa arnongilboa commented May 10, 2023

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 bz#2196429

Special notes for your reviewer:

Release note:

Propagate CDI workload NodePlacement to DataImportCron CronJob and initial Job

@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. size/XS labels May 10, 2023
@kubevirt-bot kubevirt-bot requested review from awels and maya-r May 10, 2023 14:58
@arnongilboa
Copy link
Collaborator Author

/retest

@@ -690,7 +690,7 @@ func createDataImportCronReconciler(objects ...runtime.Object) *DataImportCronRe

func createDataImportCronReconcilerWithoutConfig(objects ...runtime.Object) *DataImportCronReconciler {
crd := &extv1.CustomResourceDefinition{ObjectMeta: metav1.ObjectMeta{Name: "dataimportcrons.cdi.kubevirt.io"}}
objs := []runtime.Object{crd}
objs := []runtime.Object{crd, cc.MakeEmptyCDICR()}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe unit test that existing cronjob (carry over from upgrade etc) gets reconciled with placement values?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added

@arnongilboa arnongilboa force-pushed the dic_job_workload branch 2 times, most recently from ad1ee19 to 44479e4 Compare May 12, 2023 11:11
@arnongilboa
Copy link
Collaborator Author

/retest

if err != nil {
return false, err
}
sdk.MergeLabelsAndAnnotations(desired, current)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see you got rid of all the SDK merging utils - are we ok with that?

Copy link
Collaborator

Choose a reason for hiding this comment

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

the concern is that the deepequal will be false most of the time due to status changes/omitted spec fields

Copy link
Collaborator Author

@arnongilboa arnongilboa May 17, 2023

Choose a reason for hiding this comment

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

No need for the SDK merging utils. Regarding the DeepEqual you were right. Fixed that.

Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to DeepEqual the spec instead of the entire object? Or are the annotations/labels we are interested in?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We DeepEqual the whole object as we are intersted also in annotations/labels which may update on new version. Our CronJobs are not reconciled that often, so it won't cost too much to be on the safe side.

@arnongilboa arnongilboa force-pushed the dic_job_workload branch 2 times, most recently from cfae6bc to 2d206ea Compare May 17, 2023 13:02
@akalenyu
Copy link
Collaborator

/lgtm
/test pull-cdi-linter

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

@awels awels left a comment

Choose a reason for hiding this comment

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

looks good one minor comment

@@ -813,6 +813,10 @@ func (r *DataImportCronReconciler) newCronJob(cron *cdiv1.DataImportCron) (*batc
volumes = append(volumes, createConfigMapVolume(ProxyCertVolName, volName))
}

if len(volumes) == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

instead of volumes := []corev1.Volume{} above you can do var volumes []corev1.Volume which will make it nil. Append works fine with a nil pointer. Then you don't have to do this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

right:) fixed.

Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
@kubevirt-bot kubevirt-bot removed the lgtm Indicates that a PR is ready to be merged. label May 18, 2023
@awels
Copy link
Member

awels commented May 18, 2023

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: awels

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 May 18, 2023
@arnongilboa
Copy link
Collaborator Author

/retest

@kubevirt-bot kubevirt-bot merged commit 813632f into kubevirt:main May 18, 2023
1 check passed
arnongilboa added a commit to arnongilboa/containerized-data-importer that referenced this pull request May 30, 2023
…nd initial Job

Manual backport of kubevirt#2712

Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
arnongilboa added a commit to arnongilboa/containerized-data-importer that referenced this pull request May 30, 2023
…nd initial Job

Manual backport of kubevirt#2712

Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
kubevirt-bot pushed a commit that referenced this pull request May 30, 2023
…nd initial Job (#2733)

Manual backport of #2712

Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
kubevirt-bot pushed a commit that referenced this pull request May 30, 2023
…nd initial Job (#2734)

Manual backport of #2712

Signed-off-by: Arnon Gilboa <agilboa@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/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants