first downscaler then inherited annotations
This commit is contained in:
		
							parent
							
								
									94eaef478d
								
							
						
					
					
						commit
						621c81fc52
					
				| 
						 | 
					@ -1174,13 +1174,13 @@ func (c *Cluster) generateStatefulSet(spec *acidv1.PostgresSpec) (*appsv1.Statef
 | 
				
			||||||
	tolerationSpec := tolerations(&spec.Tolerations, c.OpConfig.PodToleration)
 | 
						tolerationSpec := tolerations(&spec.Tolerations, c.OpConfig.PodToleration)
 | 
				
			||||||
	effectivePodPriorityClassName := util.Coalesce(spec.PodPriorityClassName, c.OpConfig.PodPriorityClassName)
 | 
						effectivePodPriorityClassName := util.Coalesce(spec.PodPriorityClassName, c.OpConfig.PodPriorityClassName)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	annotations := c.generatePodAnnotations(spec)
 | 
						podAnnotations := c.generatePodAnnotations(spec)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// generate pod template for the statefulset, based on the spilo container and sidecars
 | 
						// generate pod template for the statefulset, based on the spilo container and sidecars
 | 
				
			||||||
	podTemplate, err = c.generatePodTemplate(
 | 
						podTemplate, err = c.generatePodTemplate(
 | 
				
			||||||
		c.Namespace,
 | 
							c.Namespace,
 | 
				
			||||||
		c.labelsSet(true),
 | 
							c.labelsSet(true),
 | 
				
			||||||
		c.annotationsSet(annotations),
 | 
							c.annotationsSet(podAnnotations),
 | 
				
			||||||
		spiloContainer,
 | 
							spiloContainer,
 | 
				
			||||||
		initContainers,
 | 
							initContainers,
 | 
				
			||||||
		sidecarContainers,
 | 
							sidecarContainers,
 | 
				
			||||||
| 
						 | 
					@ -1226,15 +1226,15 @@ func (c *Cluster) generateStatefulSet(spec *acidv1.PostgresSpec) (*appsv1.Statef
 | 
				
			||||||
		return nil, fmt.Errorf("could not set the pod management policy to the unknown value: %v", c.OpConfig.PodManagementPolicy)
 | 
							return nil, fmt.Errorf("could not set the pod management policy to the unknown value: %v", c.OpConfig.PodManagementPolicy)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	annotations = make(map[string]string)
 | 
						stsAnnotations := c.AnnotationsToPropagate(map[string]string{})
 | 
				
			||||||
	annotations[rollingUpdateStatefulsetAnnotationKey] = strconv.FormatBool(false)
 | 
						stsAnnotations[rollingUpdateStatefulsetAnnotationKey] = strconv.FormatBool(false)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	statefulSet := &appsv1.StatefulSet{
 | 
						statefulSet := &appsv1.StatefulSet{
 | 
				
			||||||
		ObjectMeta: metav1.ObjectMeta{
 | 
							ObjectMeta: metav1.ObjectMeta{
 | 
				
			||||||
			Name:        c.statefulSetName(),
 | 
								Name:        c.statefulSetName(),
 | 
				
			||||||
			Namespace:   c.Namespace,
 | 
								Namespace:   c.Namespace,
 | 
				
			||||||
			Labels:      c.labelsSet(true),
 | 
								Labels:      c.labelsSet(true),
 | 
				
			||||||
			Annotations: c.annotationsSet(c.AnnotationsToPropagate(annotations)),
 | 
								Annotations: c.annotationsSet(stsAnnotations),
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		Spec: appsv1.StatefulSetSpec{
 | 
							Spec: appsv1.StatefulSetSpec{
 | 
				
			||||||
			Replicas:             &numberOfInstances,
 | 
								Replicas:             &numberOfInstances,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -354,7 +354,7 @@ func (c *Cluster) syncStatefulSet() error {
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		annotations := c.AnnotationsToPropagate(c.Statefulset.Annotations)
 | 
							annotations := c.AnnotationsToPropagate(c.Statefulset.Annotations)
 | 
				
			||||||
		c.updateStatefulSetAnnotations(annotations)
 | 
							c.updateStatefulSetAnnotations(c.annotationsSet(annotations))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if !podsRollingUpdateRequired && !c.OpConfig.EnableLazySpiloUpgrade {
 | 
							if !podsRollingUpdateRequired && !c.OpConfig.EnableLazySpiloUpgrade {
 | 
				
			||||||
			// even if desired and actual statefulsets match
 | 
								// even if desired and actual statefulsets match
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue