Skip to content

Commit

Permalink
Bug 1861746: must-gather: always force disk flush after in the copy c…
Browse files Browse the repository at this point in the history
…ontainer
  • Loading branch information
soltysh committed Sep 21, 2020
1 parent e973b42 commit cf50ab9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/cli/admin/mustgather/mustgather.go
Expand Up @@ -527,7 +527,8 @@ func (o *MustGatherOptions) newPod(node, image string) *corev1.Pod {
Name: "gather",
Image: image,
ImagePullPolicy: corev1.PullIfNotPresent,
Command: []string{"/usr/bin/gather"},
// always force disk flush to ensure that all data gathered is accessible in the copy container
Command: []string{"/bin/bash", "-c", "/usr/bin/gather; sync"},
VolumeMounts: []corev1.VolumeMount{
{
Name: "must-gather-output",
Expand Down Expand Up @@ -560,7 +561,9 @@ func (o *MustGatherOptions) newPod(node, image string) *corev1.Pod {
},
}
if len(o.Command) > 0 {
ret.Spec.Containers[0].Command = o.Command
// always force disk flush to ensure that all data gathered is accessible in the copy container
ret.Spec.Containers[0].Command = []string{"/bin/bash", "-c", fmt.Sprintf("%s; sync", strings.Join(o.Command, " "))}
}

return ret
}

0 comments on commit cf50ab9

Please sign in to comment.