Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
142fe19f
Commit
142fe19f
authored
May 06, 2019
by
danielqsj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix increment-decrement lint error
parent
c516bb51
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
15 deletions
+15
-15
keyring_test.go
pkg/credentialprovider/keyring_test.go
+1
-1
storage_test.go
pkg/registry/apps/replicaset/storage/storage_test.go
+2
-2
storage_test.go
...gistry/core/replicationcontroller/storage/storage_test.go
+2
-2
math.go
staging/src/k8s.io/apimachinery/pkg/api/resource/math.go
+1
-1
jsonpath.go
staging/src/k8s.io/client-go/util/jsonpath/jsonpath.go
+6
-6
service_latency.go
test/e2e/network/service_latency.go
+1
-1
garbage_collector_test.go
test/e2e_node/garbage_collector_test.go
+2
-2
No files found.
pkg/credentialprovider/keyring_test.go
View file @
142fe19f
...
...
@@ -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
{}
}
...
...
pkg/registry/apps/replicaset/storage/storage_test.go
View file @
142fe19f
...
...
@@ -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
)
}
...
...
pkg/registry/core/replicationcontroller/storage/storage_test.go
View file @
142fe19f
...
...
@@ -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
)
}
...
...
staging/src/k8s.io/apimachinery/pkg/api/resource/math.go
View file @
142fe19f
...
...
@@ -194,7 +194,7 @@ func negativeScaleInt64(base int64, scale Scale) (result int64, exact bool) {
}
if
fraction
{
if
base
>
0
{
value
+=
1
value
++
}
else
{
value
+=
-
1
}
...
...
staging/src/k8s.io/client-go/util/jsonpath/jsonpath.go
View file @
142fe19f
...
...
@@ -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
...
...
test/e2e/network/service_latency.go
View file @
142fe19f
...
...
@@ -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
)
}
...
...
test/e2e_node/garbage_collector_test.go
View file @
142fe19f
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment