Skip to content

Commit

Permalink
Merge pull request kubevirt#10852 from muxuelanKK/main
Browse files Browse the repository at this point in the history
hotplug pod can get tolerations from launcher pod
  • Loading branch information
kubevirt-bot authored Dec 11, 2023
2 parents c5ae4a4 + 4cccc0e commit 7e3aa9f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/virt-controller/services/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,9 @@ func (t *templateService) RenderHotplugAttachmentPodTemplate(volumes []*v1.Volum
sharedMount := k8sv1.MountPropagationHostToContainer
command := []string{"/bin/sh", "-c", "/usr/bin/container-disk --copy-path /path/hp"}

tmpTolerations := make([]k8sv1.Toleration, len(ownerPod.Spec.Tolerations))
copy(tmpTolerations, ownerPod.Spec.Tolerations)

pod := &k8sv1.Pod{
ObjectMeta: metav1.ObjectMeta{
GenerateName: "hp-volume-",
Expand Down Expand Up @@ -907,6 +910,7 @@ func (t *templateService) RenderHotplugAttachmentPodTemplate(volumes []*v1.Volum
},
},
},
Tolerations: tmpTolerations,
Volumes: []k8sv1.Volume{emptyDirVolume(hotplugDisks)},
TerminationGracePeriodSeconds: &zero,
},
Expand Down Expand Up @@ -981,6 +985,9 @@ func (t *templateService) RenderHotplugAttachmentTriggerPodTemplate(volume *v1.V
annotationsList[v1.EphemeralProvisioningObject] = "true"
}

tmpTolerations := make([]k8sv1.Toleration, len(ownerPod.Spec.Tolerations))
copy(tmpTolerations, ownerPod.Spec.Tolerations)

pod := &k8sv1.Pod{
ObjectMeta: metav1.ObjectMeta{
GenerateName: "hp-volume-",
Expand Down Expand Up @@ -1038,6 +1045,7 @@ func (t *templateService) RenderHotplugAttachmentTriggerPodTemplate(volume *v1.V
},
},
},
Tolerations: tmpTolerations,
Volumes: []k8sv1.Volume{
{
Name: volume.Name,
Expand Down

0 comments on commit 7e3aa9f

Please sign in to comment.