mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-05 21:21:43 +02:00
fix k8sres and update e2e tests
This commit is contained in:
@@ -787,11 +787,11 @@ func (c *Cluster) generateStatefulSet(spec *acidv1.PostgresSpec) (*appsv1.Statef
|
||||
return nil, fmt.Errorf("could not generate resource requirements: %v", err)
|
||||
}
|
||||
|
||||
if spec.InitContainers != nil {
|
||||
if spec.InitContainers != nil && len(spec.InitContainers) > 0 {
|
||||
if c.OpConfig.EnableInitContainers {
|
||||
initContainers = spec.InitContainers
|
||||
} else {
|
||||
return nil, fmt.Errorf("InitContainers specified but globally disabled!")
|
||||
return nil, fmt.Errorf("initContainers specified but globally disabled")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -881,14 +881,14 @@ func (c *Cluster) generateStatefulSet(spec *acidv1.PostgresSpec) (*appsv1.Statef
|
||||
}
|
||||
|
||||
// generate sidecar containers
|
||||
if sideCars != nil {
|
||||
if sideCars != nil && len(sideCars) > 0 {
|
||||
if c.OpConfig.EnableSidecars {
|
||||
if sidecarContainers, err = generateSidecarContainers(sideCars, volumeMounts, defaultResources,
|
||||
c.OpConfig.SuperUsername, c.credentialSecretName(c.OpConfig.SuperUsername), c.logger); err != nil {
|
||||
return nil, fmt.Errorf("could not generate sidecar containers: %v", err)
|
||||
}
|
||||
} else {
|
||||
return nil, fmt.Errorf("Sidecar containers specified but globally disabled!")
|
||||
return nil, fmt.Errorf("sidecar containers specified but globally disabled")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user