sync streams only when they are defined in manifest
This commit is contained in:
parent
417308595a
commit
90d6016dc8
|
|
@ -361,8 +361,10 @@ func (c *Cluster) Create() error {
|
||||||
// something fails, report warning
|
// something fails, report warning
|
||||||
c.createConnectionPooler(c.installLookupFunction)
|
c.createConnectionPooler(c.installLookupFunction)
|
||||||
|
|
||||||
if err = c.syncStreams(); err != nil {
|
if len(c.Spec.Streams) > 0 {
|
||||||
c.logger.Errorf("could not create streams: %v", err)
|
if err = c.syncStreams(); err != nil {
|
||||||
|
c.logger.Errorf("could not create streams: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -859,9 +861,11 @@ func (c *Cluster) Update(oldSpec, newSpec *acidv1.Postgresql) error {
|
||||||
updateFailed = true
|
updateFailed = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := c.syncStreams(); err != nil {
|
if len(c.Spec.Streams) > 0 {
|
||||||
c.logger.Errorf("could not sync streams: %v", err)
|
if err := c.syncStreams(); err != nil {
|
||||||
updateFailed = true
|
c.logger.Errorf("could not sync streams: %v", err)
|
||||||
|
updateFailed = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !updateFailed {
|
if !updateFailed {
|
||||||
|
|
|
||||||
|
|
@ -129,10 +129,12 @@ func (c *Cluster) Sync(newSpec *acidv1.Postgresql) error {
|
||||||
return fmt.Errorf("could not sync connection pooler: %v", err)
|
return fmt.Errorf("could not sync connection pooler: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
c.logger.Debug("syncing streams")
|
if len(c.Spec.Streams) > 0 {
|
||||||
if err = c.syncStreams(); err != nil {
|
c.logger.Debug("syncing streams")
|
||||||
err = fmt.Errorf("could not sync streams: %v", err)
|
if err = c.syncStreams(); err != nil {
|
||||||
return err
|
err = fmt.Errorf("could not sync streams: %v", err)
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Major version upgrade must only run after success of all earlier operations, must remain last item in sync
|
// Major version upgrade must only run after success of all earlier operations, must remain last item in sync
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue