diff --git a/cluster/images/etcd-version-monitor/etcd-version-monitor.go b/cluster/images/etcd-version-monitor/etcd-version-monitor.go index c2b3e679e7c..eb52da046fe 100644 --- a/cluster/images/etcd-version-monitor/etcd-version-monitor.go +++ b/cluster/images/etcd-version-monitor/etcd-version-monitor.go @@ -191,7 +191,7 @@ func (m *monitorGatherer) rewriteExportedMetrics(metrics map[string]*dto.MetricF return results, nil } -// Struct for unmarshalling the json response from etcd's /version endpoint. +// EtcdVersion struct for unmarshalling the json response from etcd's /version endpoint. type EtcdVersion struct { BinaryVersion string `json:"etcdserver"` ClusterVersion string `json:"etcdcluster"` diff --git a/hack/.golint_failures b/hack/.golint_failures index 1c5e2fa961d..2614b3fcb19 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -1,4 +1,3 @@ -cluster/images/etcd-version-monitor cmd/cloud-controller-manager/app/apis/config/v1alpha1 cmd/hyperkube cmd/kube-apiserver/app diff --git a/pkg/controller/controller_utils.go b/pkg/controller/controller_utils.go index dbcafd4fc02..1a0324f7a84 100644 --- a/pkg/controller/controller_utils.go +++ b/pkg/controller/controller_utils.go @@ -593,9 +593,9 @@ func (r RealPodControl) DeletePod(namespace string, podID string, object runtime if err := r.KubeClient.CoreV1().Pods(namespace).Delete(podID, nil); err != nil && !apierrors.IsNotFound(err) { r.Recorder.Eventf(object, v1.EventTypeWarning, FailedDeletePodReason, "Error deleting: %v", err) return fmt.Errorf("unable to delete pods: %v", err) - } else { - r.Recorder.Eventf(object, v1.EventTypeNormal, SuccessfulDeletePodReason, "Deleted pod: %v", podID) } + r.Recorder.Eventf(object, v1.EventTypeNormal, SuccessfulDeletePodReason, "Deleted pod: %v", podID) + return nil } diff --git a/pkg/controller/cronjob/cronjob_controller_test.go b/pkg/controller/cronjob/cronjob_controller_test.go index 1ca289d441e..acb96656f2c 100644 --- a/pkg/controller/cronjob/cronjob_controller_test.go +++ b/pkg/controller/cronjob/cronjob_controller_test.go @@ -36,8 +36,8 @@ import ( var ( // schedule is hourly on the hour - onTheHour string = "0 * * * ?" - errorSchedule string = "obvious error schedule" + onTheHour = "0 * * * ?" + errorSchedule = "obvious error schedule" ) func justBeforeTheHour() time.Time { @@ -160,8 +160,8 @@ var ( A batchV1beta1.ConcurrencyPolicy = batchV1beta1.AllowConcurrent f batchV1beta1.ConcurrencyPolicy = batchV1beta1.ForbidConcurrent R batchV1beta1.ConcurrencyPolicy = batchV1beta1.ReplaceConcurrent - T bool = true - F bool = false + T = true + F = false ) func TestSyncOne_RunOrNot(t *testing.T) { @@ -347,7 +347,7 @@ func TestSyncOne_RunOrNot(t *testing.T) { for i := 1; i <= len(recorder.Events); i++ { e := <-recorder.Events if strings.HasPrefix(e, v1.EventTypeWarning) { - numWarnings += 1 + numWarnings++ } } if numWarnings != tc.expectedWarnings { diff --git a/pkg/controller/deployment/util/hash_test.go b/pkg/controller/deployment/util/hash_test.go index 7604ba04290..dc63b37b8b3 100644 --- a/pkg/controller/deployment/util/hash_test.go +++ b/pkg/controller/deployment/util/hash_test.go @@ -108,9 +108,9 @@ func TestPodTemplateSpecHash(t *testing.T) { seenHashes := make(map[string]int) for i := 0; i < 1000; i++ { - specJson := strings.Replace(podSpec, "@@VERSION@@", strconv.Itoa(i), 1) + specJSON := strings.Replace(podSpec, "@@VERSION@@", strconv.Itoa(i), 1) spec := v1.PodTemplateSpec{} - json.Unmarshal([]byte(specJson), &spec) + json.Unmarshal([]byte(specJSON), &spec) hash := controller.ComputeHash(&spec, nil) if v, ok := seenHashes[hash]; ok { t.Errorf("Hash collision, old: %d new: %d", v, i) diff --git a/pkg/controller/namespace/doc.go b/pkg/controller/namespace/doc.go index f58f816c051..82885aa8c54 100644 --- a/pkg/controller/namespace/doc.go +++ b/pkg/controller/namespace/doc.go @@ -14,5 +14,5 @@ See the License for the specific language governing permissions and limitations under the License. */ -// namespace contains a controller that handles namespace lifecycle +// Package namespace contains a controller that handles namespace lifecycle package namespace // import "k8s.io/kubernetes/pkg/controller/namespace"