MCPcopy Index your code
hub / github.com/zalando/postgres-operator / logStatefulSetChanges

Method logStatefulSetChanges

pkg/cluster/util.go:200–221  ·  view source on GitHub ↗
(old, new *appsv1.StatefulSet, isUpdate bool, reasons []string)

Source from the content-addressed store, hash-verified

198}
199
200func (c *Cluster) logStatefulSetChanges(old, new *appsv1.StatefulSet, isUpdate bool, reasons []string) {
201 if isUpdate {
202 c.logger.Infof("statefulset %s has been changed", util.NameFromMeta(old.ObjectMeta))
203 } else {
204 c.logger.Infof("statefulset %s is not in the desired state and needs to be updated",
205 util.NameFromMeta(old.ObjectMeta),
206 )
207 }
208
209 logNiceDiff(c.logger, old.Spec, new.Spec)
210
211 if !reflect.DeepEqual(old.Annotations, new.Annotations) {
212 c.logger.Debug("metadata.annotation are different")
213 logNiceDiff(c.logger, old.Annotations, new.Annotations)
214 }
215
216 if len(reasons) > 0 {
217 for _, reason := range reasons {
218 c.logger.Infof("reason: %s", reason)
219 }
220 }
221}
222
223func (c *Cluster) logServiceChanges(role PostgresRole, old, new *v1.Service, isUpdate bool, reason string) {
224 if isUpdate {

Callers 1

syncStatefulSetMethod · 0.95

Calls 2

NameFromMetaFunction · 0.92
logNiceDiffFunction · 0.85

Tested by

no test coverage detected