-
Notifications
You must be signed in to change notification settings - Fork 248
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
Conversation
/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()} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
ad1ee19
to
44479e4
Compare
/retest |
if err != nil { | ||
return false, err | ||
} | ||
sdk.MergeLabelsAndAnnotations(desired, current) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
cfae6bc
to
2d206ea
Compare
/lgtm |
There was a problem hiding this 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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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>
2d206ea
to
ba44588
Compare
/lgtm |
[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 |
/retest |
…nd initial Job Manual backport of kubevirt#2712 Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
…nd initial Job Manual backport of kubevirt#2712 Signed-off-by: Arnon Gilboa <agilboa@redhat.com>
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: