Implement golangci comments

This commit is contained in:
faizanahmad055
2018-07-13 17:08:46 +05:00
parent c3135ce41f
commit c58efd19bf
2 changed files with 6 additions and 2 deletions
+2 -1
View File
@@ -14,6 +14,7 @@ import (
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/util/workqueue"
)
// ResourceUpdated contains new or updated objects
type ResourceUpdated struct {
newObj interface{}
@@ -126,7 +127,7 @@ func (c *Controller) takeAction(resourceUpdated ResourceUpdated) error {
} else {
logrus.Infof("Detected changes in object %s", newObj)
// process events based on its type
if(oldObj == nil){
if oldObj == nil {
logrus.Infof("Performing 'Added' action for controller of type '%s'", c.resource)
} else {
logrus.Infof("Performing 'Updated' action for controller of type '%s'", c.resource)
+4 -1
View File
@@ -71,7 +71,10 @@ func TestControllerForUpdatingConfigmapShouldUpdateDeployment(t *testing.T) {
}
time.Sleep(10 * time.Second)
logrus.Infof("Deleting Deployment %q.\n", deployment.GetObjectMeta().GetName())
controller.client.Extensions().Deployments(namespace).Delete(configmapName, &metav1.DeleteOptions{})
deploymentError := controller.client.Extensions().Deployments(namespace).Delete(configmapName, &metav1.DeleteOptions{})
if deploymentError != nil {
logrus.Infof("Error while deleting the configmap %v", deploymentError)
}
logrus.Infof("Deleting Configmap %q.\n", configmapName)
error := controller.client.CoreV1().ConfigMaps(namespace).Delete(configmapName, &metav1.DeleteOptions{})
if error != nil {