mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-09 06:15:44 +02:00
Fix the golint, gosimple warnings
This commit is contained in:
+8
-8
@@ -10,7 +10,10 @@ func (c *Cluster) Sync(stopCh <-chan struct{}) error {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
|
||||
c.loadResources()
|
||||
err := c.loadResources()
|
||||
if err != nil {
|
||||
c.logger.Errorf("Can't load resources: %s", err)
|
||||
}
|
||||
|
||||
if !c.podDispatcherRunning {
|
||||
go c.podEventsDispatcher(stopCh)
|
||||
@@ -59,11 +62,8 @@ func (c *Cluster) syncSecrets() error {
|
||||
}
|
||||
|
||||
err := c.applySecrets()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return nil
|
||||
return err
|
||||
}
|
||||
|
||||
func (c *Cluster) syncService() error {
|
||||
@@ -80,11 +80,11 @@ func (c *Cluster) syncService() error {
|
||||
}
|
||||
|
||||
desiredSvc := c.genService(cSpec.AllowedSourceRanges)
|
||||
if match, reason := c.sameServiceWith(desiredSvc); match {
|
||||
match, reason := c.sameServiceWith(desiredSvc)
|
||||
if match {
|
||||
return nil
|
||||
} else {
|
||||
c.logServiceChanges(c.Service, desiredSvc, false, reason)
|
||||
}
|
||||
c.logServiceChanges(c.Service, desiredSvc, false, reason)
|
||||
|
||||
if err := c.updateService(desiredSvc); err != nil {
|
||||
return fmt.Errorf("Can't update Service to match desired state: %s", err)
|
||||
|
||||
Reference in New Issue
Block a user