Skip to content

Commit

Permalink
ceph: apply csi provisioner node-affinity to csi version check job
Browse files Browse the repository at this point in the history
This commit makes sure csi provisioner node-affinity is applied
to the csi version check job as well, similar to the how
the existing csi provisioner toleration is applied to the job.

Fixes: #8323

Signed-off-by: Rakshith R <rar@redhat.com>
  • Loading branch information
Rakshith-R committed Oct 13, 2021
1 parent 7590bf0 commit c1ef189
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/operator/ceph/csi/spec.go
Expand Up @@ -640,8 +640,11 @@ func (r *ReconcileCSI) validateCSIVersion(ownerInfo *k8sutil.OwnerInfo) (*CephCS
job := versionReporter.Job()
job.Spec.Template.Spec.ServiceAccountName = r.opConfig.ServiceAccount

// Apply csi provisioner toleration for csi version check job
// Apply csi provisioner toleration and affinity for csi version check job
job.Spec.Template.Spec.Tolerations = getToleration(r.opConfig.Parameters, provisionerTolerationsEnv, []corev1.Toleration{})
job.Spec.Template.Spec.Affinity = &corev1.Affinity{
NodeAffinity: getNodeAffinity(r.opConfig.Parameters, provisionerNodeAffinityEnv, &corev1.NodeAffinity{}),
}
stdout, _, retcode, err := versionReporter.Run(timeout)
if err != nil {
return nil, errors.Wrap(err, "failed to complete ceph CSI version job")
Expand Down

0 comments on commit c1ef189

Please sign in to comment.