Address code review by @zerg-junior
- new info messages, rename the annotation flag.
This commit is contained in:
parent
0c616a802f
commit
11d568bf65
|
|
@ -18,7 +18,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
RollingUpdateStatefulsetAnnotationKey = "zalando-postgres-operator-rolling-update"
|
RollingUpdateStatefulsetAnnotationKey = "zalando-postgres-operator-rolling-update-required"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (c *Cluster) listResources() error {
|
func (c *Cluster) listResources() error {
|
||||||
|
|
|
||||||
|
|
@ -247,6 +247,7 @@ func (c *Cluster) syncStatefulSet() error {
|
||||||
|
|
||||||
podsRollingUpdateRequired = (len(pods) > 0)
|
podsRollingUpdateRequired = (len(pods) > 0)
|
||||||
if podsRollingUpdateRequired {
|
if podsRollingUpdateRequired {
|
||||||
|
c.logger.Warningf("found pods from the previous statefulset: trigger rolling update")
|
||||||
c.applyRollingUpdateFlagforStatefulSet(podsRollingUpdateRequired)
|
c.applyRollingUpdateFlagforStatefulSet(podsRollingUpdateRequired)
|
||||||
}
|
}
|
||||||
c.logger.Infof("created missing statefulset %q", util.NameFromMeta(sset.ObjectMeta))
|
c.logger.Infof("created missing statefulset %q", util.NameFromMeta(sset.ObjectMeta))
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import (
|
||||||
"github.com/zalando-incubator/postgres-operator/pkg/util/constants"
|
"github.com/zalando-incubator/postgres-operator/pkg/util/constants"
|
||||||
"github.com/zalando-incubator/postgres-operator/pkg/util/k8sutil"
|
"github.com/zalando-incubator/postgres-operator/pkg/util/k8sutil"
|
||||||
"github.com/zalando-incubator/postgres-operator/pkg/util/retryutil"
|
"github.com/zalando-incubator/postgres-operator/pkg/util/retryutil"
|
||||||
|
"reflect"
|
||||||
)
|
)
|
||||||
|
|
||||||
// OAuthTokenGetter provides the method for fetching OAuth tokens
|
// OAuthTokenGetter provides the method for fetching OAuth tokens
|
||||||
|
|
@ -172,7 +173,10 @@ func (c *Cluster) logStatefulSetChanges(old, new *v1beta1.StatefulSet, isUpdate
|
||||||
util.NameFromMeta(old.ObjectMeta),
|
util.NameFromMeta(old.ObjectMeta),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
c.logger.Debugf("diff\n%s\n", util.PrettyDiff(old.Spec, new.Spec))
|
if !reflect.DeepEqual(old.Annotations, new.Annotations) {
|
||||||
|
c.logger.Debugf("metadata.annotation diff\n%s\n", util.PrettyDiff(old.Annotations, new.Annotations))
|
||||||
|
}
|
||||||
|
c.logger.Debugf("spec diff\n%s\n", util.PrettyDiff(old.Spec, new.Spec))
|
||||||
|
|
||||||
if len(reasons) > 0 {
|
if len(reasons) > 0 {
|
||||||
for _, reason := range reasons {
|
for _, reason := range reasons {
|
||||||
|
|
|
||||||
|
|
@ -131,8 +131,13 @@ func SameService(cur, new *v1.Service) (match bool, reason string) {
|
||||||
oldELBAnnotation := cur.Annotations[constants.ElbTimeoutAnnotationName]
|
oldELBAnnotation := cur.Annotations[constants.ElbTimeoutAnnotationName]
|
||||||
newELBAnnotation := new.Annotations[constants.ElbTimeoutAnnotationName]
|
newELBAnnotation := new.Annotations[constants.ElbTimeoutAnnotationName]
|
||||||
|
|
||||||
if oldDNSAnnotation != newDNSAnnotation || oldELBAnnotation != newELBAnnotation {
|
if oldDNSAnnotation != newDNSAnnotation {
|
||||||
return false, fmt.Sprintf("new service's %q annotation doesn't match the current one", constants.ZalandoDNSNameAnnotation)
|
return false, fmt.Sprintf("new service's %q annotation value %q doesn't match the current one %q",
|
||||||
|
constants.ZalandoDNSNameAnnotation, newDNSAnnotation, oldDNSAnnotation)
|
||||||
|
}
|
||||||
|
if oldELBAnnotation != newELBAnnotation {
|
||||||
|
return false, fmt.Sprintf("new service's %q annotation value %q doesn't match the current one %q",
|
||||||
|
constants.ElbTimeoutAnnotationName, oldELBAnnotation, newELBAnnotation)
|
||||||
}
|
}
|
||||||
|
|
||||||
return true, ""
|
return true, ""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue