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 19:56:14 +07:00 committed by GitHub
parent eeb59c5bfd
commit af5378eea5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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}
}