diff --git a/pkg/credentialprovider/keyring_test.go b/pkg/credentialprovider/keyring_test.go index 128670d19c..0605045710 100644 --- a/pkg/credentialprovider/keyring_test.go +++ b/pkg/credentialprovider/keyring_test.go @@ -470,7 +470,7 @@ func (d *testProvider) LazyProvide(image string) *DockerConfigEntry { // Provide implements dockerConfigProvider func (d *testProvider) Provide(image string) DockerConfig { - d.Count += 1 + d.Count++ return DockerConfig{} } diff --git a/pkg/registry/apps/replicaset/storage/storage_test.go b/pkg/registry/apps/replicaset/storage/storage_test.go index 48420b8f23..aff7945edf 100644 --- a/pkg/registry/apps/replicaset/storage/storage_test.go +++ b/pkg/registry/apps/replicaset/storage/storage_test.go @@ -173,7 +173,7 @@ func TestGenerationNumber(t *testing.T) { } // Updates to spec should increment the generation number - storedRS.Spec.Replicas += 1 + storedRS.Spec.Replicas++ if _, _, err := storage.ReplicaSet.Update(ctx, storedRS.Name, rest.DefaultUpdatedObjectInfo(storedRS), rest.ValidateAllObjectFunc, rest.ValidateAllObjectUpdateFunc, false, &metav1.UpdateOptions{}); err != nil { t.Errorf("unexpected error: %v", err) } @@ -187,7 +187,7 @@ func TestGenerationNumber(t *testing.T) { } // Updates to status should not increment either spec or status generation numbers - storedRS.Status.Replicas += 1 + storedRS.Status.Replicas++ if _, _, err := storage.ReplicaSet.Update(ctx, storedRS.Name, rest.DefaultUpdatedObjectInfo(storedRS), rest.ValidateAllObjectFunc, rest.ValidateAllObjectUpdateFunc, false, &metav1.UpdateOptions{}); err != nil { t.Errorf("unexpected error: %v", err) } diff --git a/pkg/registry/core/replicationcontroller/storage/storage_test.go b/pkg/registry/core/replicationcontroller/storage/storage_test.go index c96491374e..a82565d0e4 100644 --- a/pkg/registry/core/replicationcontroller/storage/storage_test.go +++ b/pkg/registry/core/replicationcontroller/storage/storage_test.go @@ -176,7 +176,7 @@ func TestGenerationNumber(t *testing.T) { } // Updates to spec should increment the generation number - controller.Spec.Replicas += 1 + controller.Spec.Replicas++ if _, _, err := storage.Controller.Update(ctx, controller.Name, rest.DefaultUpdatedObjectInfo(controller), rest.ValidateAllObjectFunc, rest.ValidateAllObjectUpdateFunc, false, &metav1.UpdateOptions{}); err != nil { t.Errorf("unexpected error: %v", err) } @@ -190,7 +190,7 @@ func TestGenerationNumber(t *testing.T) { } // Updates to status should not increment either spec or status generation numbers - controller.Status.Replicas += 1 + controller.Status.Replicas++ if _, _, err := storage.Controller.Update(ctx, controller.Name, rest.DefaultUpdatedObjectInfo(controller), rest.ValidateAllObjectFunc, rest.ValidateAllObjectUpdateFunc, false, &metav1.UpdateOptions{}); err != nil { t.Errorf("unexpected error: %v", err) } diff --git a/staging/src/k8s.io/apimachinery/pkg/api/resource/math.go b/staging/src/k8s.io/apimachinery/pkg/api/resource/math.go index 72d3880c02..7f63175d3e 100644 --- a/staging/src/k8s.io/apimachinery/pkg/api/resource/math.go +++ b/staging/src/k8s.io/apimachinery/pkg/api/resource/math.go @@ -194,9 +194,9 @@ func negativeScaleInt64(base int64, scale Scale) (result int64, exact bool) { } if fraction { if base > 0 { - value += 1 + value++ } else { - value += -1 + value-- } } return value, !fraction diff --git a/staging/src/k8s.io/client-go/util/jsonpath/jsonpath.go b/staging/src/k8s.io/client-go/util/jsonpath/jsonpath.go index a5a8bbf7a3..78b6b678f7 100644 --- a/staging/src/k8s.io/client-go/util/jsonpath/jsonpath.go +++ b/staging/src/k8s.io/client-go/util/jsonpath/jsonpath.go @@ -93,17 +93,17 @@ func (j *JSONPath) FindResults(data interface{}) ([][]reflect.Value, error) { // encounter an end node, break the current block if j.endRange > 0 && j.endRange <= j.inRange { - j.endRange -= 1 + j.endRange-- break } // encounter a range node, start a range loop if j.beginRange > 0 { - j.beginRange -= 1 - j.inRange += 1 + j.beginRange-- + j.inRange++ for k, value := range results { j.parser.Root.Nodes = nodes[i+1:] if k == len(results)-1 { - j.inRange -= 1 + j.inRange-- } nextResults, err := j.FindResults(value.Interface()) if err != nil { @@ -213,11 +213,11 @@ func (j *JSONPath) evalIdentifier(input []reflect.Value, node *IdentifierNode) ( switch node.Name { case "range": j.stack = append(j.stack, j.cur) - j.beginRange += 1 + j.beginRange++ results = input case "end": if j.endRange < j.inRange { // inside a loop, break the current block - j.endRange += 1 + j.endRange++ break } // the loop is about to end, pop value and continue the following execution diff --git a/test/e2e/network/service_latency.go b/test/e2e/network/service_latency.go index a122b816c9..e374fa6050 100644 --- a/test/e2e/network/service_latency.go +++ b/test/e2e/network/service_latency.go @@ -177,7 +177,7 @@ func runServiceLatencies(f *framework.Framework, inParallel, total int, acceptab select { case e := <-errs: e2elog.Logf("Got error: %v", e) - errCount += 1 + errCount++ case d := <-durations: output = append(output, d) } diff --git a/test/e2e_node/garbage_collector_test.go b/test/e2e_node/garbage_collector_test.go index d57139b1a1..7815fcbce0 100644 --- a/test/e2e_node/garbage_collector_test.go +++ b/test/e2e_node/garbage_collector_test.go @@ -200,7 +200,7 @@ func containerGCTest(f *framework.Framework, test testRun) { containerCount := 0 for _, containerName := range containerNames { if containerName == pod.getContainerName(i) { - containerCount += 1 + containerCount++ } } if containerCount > maxPerPodContainer+1 { @@ -228,7 +228,7 @@ func containerGCTest(f *framework.Framework, test testRun) { containerCount := 0 for _, containerName := range containerNames { if containerName == pod.getContainerName(i) { - containerCount += 1 + containerCount++ } } if pod.restartCount > 0 && containerCount < maxPerPodContainer+1 {