Skip to content

Commit

Permalink
fix: add uncompress init container to fluentd drainer job (#1320)
Browse files Browse the repository at this point in the history
  • Loading branch information
aslafy-z authored and pepov committed May 20, 2023
1 parent ebf7ec0 commit c5530fc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/resources/fluentd/drainjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ func (r *Reconciler) drainerJobFor(pvc corev1.PersistentVolumeClaim) (*batchv1.J
containers = append(containers, *c)
}

var initContainers []corev1.Container
if i := generateInitContainer(r.Logging.Spec.FluentdSpec); i != nil {
initContainers = append(initContainers, *i)
}

spec := batchv1.JobSpec{
Template: corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Expand All @@ -49,6 +54,7 @@ func (r *Reconciler) drainerJobFor(pvc corev1.PersistentVolumeClaim) (*batchv1.J
Volumes: r.generateVolume(),
ServiceAccountName: r.getServiceAccount(),
ImagePullSecrets: r.Logging.Spec.FluentdSpec.Image.ImagePullSecrets,
InitContainers: initContainers,
Containers: containers,
NodeSelector: r.Logging.Spec.FluentdSpec.NodeSelector,
Tolerations: r.Logging.Spec.FluentdSpec.Tolerations,
Expand Down

0 comments on commit c5530fc

Please sign in to comment.