use clearer messages
This commit is contained in:
		
							parent
							
								
									c11820ce78
								
							
						
					
					
						commit
						6248beac01
					
				|  | @ -789,7 +789,7 @@ func (c *Cluster) generateStatefulSet(spec *acidv1.PostgresSpec) (*appsv1.Statef | ||||||
| 
 | 
 | ||||||
| 	if spec.InitContainers != nil && len(spec.InitContainers) > 0 { | 	if spec.InitContainers != nil && len(spec.InitContainers) > 0 { | ||||||
| 		if c.OpConfig.EnableInitContainers != nil && !(*c.OpConfig.EnableInitContainers) { | 		if c.OpConfig.EnableInitContainers != nil && !(*c.OpConfig.EnableInitContainers) { | ||||||
| 			c.logger.Warningf("initContainers in use but globally disabled - next statefulSet creation would fail") | 			c.logger.Warningf("initContainers specified but disabled in configuration - next statefulset creation would fail") | ||||||
| 		} | 		} | ||||||
| 		initContainers = spec.InitContainers | 		initContainers = spec.InitContainers | ||||||
| 	} | 	} | ||||||
|  | @ -882,7 +882,7 @@ func (c *Cluster) generateStatefulSet(spec *acidv1.PostgresSpec) (*appsv1.Statef | ||||||
| 	// generate sidecar containers
 | 	// generate sidecar containers
 | ||||||
| 	if sideCars != nil && len(sideCars) > 0 { | 	if sideCars != nil && len(sideCars) > 0 { | ||||||
| 		if c.OpConfig.EnableSidecars != nil && !(*c.OpConfig.EnableSidecars) { | 		if c.OpConfig.EnableSidecars != nil && !(*c.OpConfig.EnableSidecars) { | ||||||
| 			c.logger.Warningf("sidecars in use but globally disabled - next stateful set creation would fail") | 			c.logger.Warningf("sidecars specified but disabled in configuration - next statefulset creation would fail") | ||||||
| 		} | 		} | ||||||
| 		if sidecarContainers, err = generateSidecarContainers(sideCars, volumeMounts, defaultResources, | 		if sidecarContainers, err = generateSidecarContainers(sideCars, volumeMounts, defaultResources, | ||||||
| 			c.OpConfig.SuperUsername, c.credentialSecretName(c.OpConfig.SuperUsername), c.logger); err != nil { | 			c.OpConfig.SuperUsername, c.credentialSecretName(c.OpConfig.SuperUsername), c.logger); err != nil { | ||||||
|  |  | ||||||
|  | @ -68,12 +68,12 @@ func (c *Cluster) createStatefulSet() (*appsv1.StatefulSet, error) { | ||||||
| 	// check if it's allowed that spec contains initContainers
 | 	// check if it's allowed that spec contains initContainers
 | ||||||
| 	if c.Spec.InitContainers != nil && len(c.Spec.InitContainers) > 0 && | 	if c.Spec.InitContainers != nil && len(c.Spec.InitContainers) > 0 && | ||||||
| 		c.OpConfig.EnableInitContainers != nil && !(*c.OpConfig.EnableInitContainers) { | 		c.OpConfig.EnableInitContainers != nil && !(*c.OpConfig.EnableInitContainers) { | ||||||
| 		return nil, fmt.Errorf("initContainers specified but globally disabled") | 		return nil, fmt.Errorf("initContainers specified but disabled in configuration") | ||||||
| 	} | 	} | ||||||
| 	// check if it's allowed that spec contains sidecars
 | 	// check if it's allowed that spec contains sidecars
 | ||||||
| 	if c.Spec.Sidecars != nil && len(c.Spec.Sidecars) > 0 && | 	if c.Spec.Sidecars != nil && len(c.Spec.Sidecars) > 0 && | ||||||
| 		c.OpConfig.EnableSidecars != nil && !(*c.OpConfig.EnableSidecars) { | 		c.OpConfig.EnableSidecars != nil && !(*c.OpConfig.EnableSidecars) { | ||||||
| 		return nil, fmt.Errorf("sidecar containers specified but globally disabled") | 		return nil, fmt.Errorf("sidecar containers specified but disabled in configuration") | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	statefulSetSpec, err := c.generateStatefulSet(&c.Spec) | 	statefulSetSpec, err := c.generateStatefulSet(&c.Spec) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue