diff --git a/hack/.staticcheck_failures b/hack/.staticcheck_failures index 1e170220eaf32..816261ef530ed 100644 --- a/hack/.staticcheck_failures +++ b/hack/.staticcheck_failures @@ -1,5 +1,4 @@ cluster/images/etcd/migrate -pkg/controller/deployment pkg/controller/garbagecollector pkg/controller/nodeipam pkg/controller/podautoscaler diff --git a/pkg/controller/deployment/deployment_controller.go b/pkg/controller/deployment/deployment_controller.go index 926c9dc2b69c7..3a74336d224fa 100644 --- a/pkg/controller/deployment/deployment_controller.go +++ b/pkg/controller/deployment/deployment_controller.go @@ -182,12 +182,12 @@ func (dc *DeploymentController) deleteDeployment(obj interface{}) { if !ok { tombstone, ok := obj.(cache.DeletedFinalStateUnknown) if !ok { - utilruntime.HandleError(fmt.Errorf("Couldn't get object from tombstone %#v", obj)) + utilruntime.HandleError(fmt.Errorf("couldn't get object from tombstone %#v", obj)) return } d, ok = tombstone.Obj.(*apps.Deployment) if !ok { - utilruntime.HandleError(fmt.Errorf("Tombstone contained object that is not a Deployment %#v", obj)) + utilruntime.HandleError(fmt.Errorf("tombstone contained object that is not a Deployment %#v", obj)) return } } @@ -311,12 +311,12 @@ func (dc *DeploymentController) deleteReplicaSet(obj interface{}) { if !ok { tombstone, ok := obj.(cache.DeletedFinalStateUnknown) if !ok { - utilruntime.HandleError(fmt.Errorf("Couldn't get object from tombstone %#v", obj)) + utilruntime.HandleError(fmt.Errorf("couldn't get object from tombstone %#v", obj)) return } rs, ok = tombstone.Obj.(*apps.ReplicaSet) if !ok { - utilruntime.HandleError(fmt.Errorf("Tombstone contained object that is not a ReplicaSet %#v", obj)) + utilruntime.HandleError(fmt.Errorf("tombstone contained object that is not a ReplicaSet %#v", obj)) return } } @@ -345,12 +345,12 @@ func (dc *DeploymentController) deletePod(obj interface{}) { if !ok { tombstone, ok := obj.(cache.DeletedFinalStateUnknown) if !ok { - utilruntime.HandleError(fmt.Errorf("Couldn't get object from tombstone %#v", obj)) + utilruntime.HandleError(fmt.Errorf("couldn't get object from tombstone %#v", obj)) return } pod, ok = tombstone.Obj.(*v1.Pod) if !ok { - utilruntime.HandleError(fmt.Errorf("Tombstone contained object that is not a pod %#v", obj)) + utilruntime.HandleError(fmt.Errorf("tombstone contained object that is not a pod %#v", obj)) return } } @@ -378,7 +378,7 @@ func (dc *DeploymentController) deletePod(obj interface{}) { func (dc *DeploymentController) enqueue(deployment *apps.Deployment) { key, err := controller.KeyFunc(deployment) if err != nil { - utilruntime.HandleError(fmt.Errorf("Couldn't get key for object %#v: %v", deployment, err)) + utilruntime.HandleError(fmt.Errorf("couldn't get key for object %#v: %v", deployment, err)) return } @@ -388,7 +388,7 @@ func (dc *DeploymentController) enqueue(deployment *apps.Deployment) { func (dc *DeploymentController) enqueueRateLimited(deployment *apps.Deployment) { key, err := controller.KeyFunc(deployment) if err != nil { - utilruntime.HandleError(fmt.Errorf("Couldn't get key for object %#v: %v", deployment, err)) + utilruntime.HandleError(fmt.Errorf("couldn't get key for object %#v: %v", deployment, err)) return } @@ -399,7 +399,7 @@ func (dc *DeploymentController) enqueueRateLimited(deployment *apps.Deployment) func (dc *DeploymentController) enqueueAfter(deployment *apps.Deployment, after time.Duration) { key, err := controller.KeyFunc(deployment) if err != nil { - utilruntime.HandleError(fmt.Errorf("Couldn't get key for object %#v: %v", deployment, err)) + utilruntime.HandleError(fmt.Errorf("couldn't get key for object %#v: %v", deployment, err)) return } diff --git a/pkg/controller/deployment/sync.go b/pkg/controller/deployment/sync.go index c58ccab411107..3c7e808b24bbf 100644 --- a/pkg/controller/deployment/sync.go +++ b/pkg/controller/deployment/sync.go @@ -98,7 +98,7 @@ func (dc *DeploymentController) checkPausedConditions(d *apps.Deployment) error } var err error - d, err = dc.client.AppsV1().Deployments(d.Namespace).UpdateStatus(context.TODO(), d, metav1.UpdateOptions{}) + _, err = dc.client.AppsV1().Deployments(d.Namespace).UpdateStatus(context.TODO(), d, metav1.UpdateOptions{}) return err } @@ -173,7 +173,7 @@ func (dc *DeploymentController) getNewReplicaSet(d *apps.Deployment, rsList, old if needsUpdate { var err error - if d, err = dc.client.AppsV1().Deployments(d.Namespace).UpdateStatus(context.TODO(), d, metav1.UpdateOptions{}); err != nil { + if _, err = dc.client.AppsV1().Deployments(d.Namespace).UpdateStatus(context.TODO(), d, metav1.UpdateOptions{}); err != nil { return nil, err } }