This patch consists of various corrections. (#73060)

* This patch consists of various corrections.

*) Remove unwanted `else` code block
*) Adjust variable intialization.
*) Correct error strings.
*) Use recommended variable increment method.

Signed-off-by: hchiramm <hchiramm@redhat.com>

* Remove cluster/images/cluster-version-monitor from hack/.golint_failures.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
Humble Devassy Chirammal
2019-01-23 01:58:59 +05:30
committed by Kubernetes Prow Robot
parent e1e85f947e
commit 2651c72166
6 changed files with 11 additions and 12 deletions

View File

@@ -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)