Skip to content

Commit

Permalink
fix: add missing logic to handle PVCs for extraVolumes (#1304)
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Wilcsinszky <peter.wilcsinszky@axoflow.com>
  • Loading branch information
pepov authored and aslafy-z committed May 23, 2023
1 parent e5c2028 commit db08c1a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pkg/resources/fluentd/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,16 @@ func (r *Reconciler) statefulset() (runtime.Object, reconciler.DesiredState, err
}
}
for _, n := range r.Logging.Spec.FluentdSpec.ExtraVolumes {
if err := n.ApplyVolumeForPodSpec(&spec.Template.Spec); err != nil {
return nil, reconciler.StatePresent, err
if n.Volume != nil && n.Volume.PersistentVolumeClaim != nil {
if err := n.Volume.ApplyPVCForStatefulSet(n.ContainerName, n.Path, spec, func(name string) metav1.ObjectMeta {
return r.FluentdObjectMeta(name, ComponentFluentd)
}); err != nil {
return nil, reconciler.StatePresent, err
}
} else {
if err := n.ApplyVolumeForPodSpec(&spec.Template.Spec); err != nil {
return nil, reconciler.StatePresent, err
}
}
}

Expand Down

0 comments on commit db08c1a

Please sign in to comment.