Mount additional volumes to 'postgres' container when 'targetContains` is an empty list (#1475)

* Mount additional volumes to 'postgres' container when 'targetContainers' is an empty list

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>

Co-authored-by: Felix Kunde <felix-kunde@gmx.de>
This commit is contained in:
Quan Hoang
2021-05-27 14:56:14 +02:00
committed by GitHub
co-authored by Felix Kunde
parent eeb59c5bfd
commit af5378eea5
+1 -1
View File
@@ -1452,7 +1452,7 @@ func (c *Cluster) addAdditionalVolumes(podSpec *v1.PodSpec,
continue
}
if v.TargetContainers == nil {
if len(v.TargetContainers) == 0 {
spiloContainer := podSpec.Containers[0]
additionalVolumes[i].TargetContainers = []string{spiloContainer.Name}
}