Merge pull request #77479 from danielqsj/id

fix increment-decrement lint error
k3s-v1.15.3
Kubernetes Prow Robot 2019-05-07 22:14:45 -07:00 committed by GitHub
commit 11a46d2515
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 16 additions and 16 deletions

View File

@ -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{}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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