Fix the golint, gosimple warnings

This commit is contained in:
Murat Kabilov
2017-05-18 17:38:54 +02:00
committed by GitHub
parent 233e8529c1
commit d34273543e
19 changed files with 91 additions and 133 deletions
+8 -8
View File
@@ -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)