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
04be2c41
Commit
04be2c41
authored
May 09, 2019
by
Àbéjídé Àyodélé
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up pkg/api.
These are based on recommendation from [staticcheck](
http://staticcheck.io/
).
parent
524169fe
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
8 deletions
+7
-8
util_test.go
pkg/api/service/util_test.go
+2
-2
copy_test.go
pkg/api/testing/copy_test.go
+1
-1
serialization_test.go
pkg/api/testing/serialization_test.go
+1
-1
util_test.go
pkg/api/v1/pod/util_test.go
+1
-2
util_test.go
pkg/api/v1/service/util_test.go
+2
-2
No files found.
pkg/api/service/util_test.go
View file @
04be2c41
...
@@ -53,13 +53,13 @@ func TestGetLoadBalancerSourceRanges(t *testing.T) {
...
@@ -53,13 +53,13 @@ func TestGetLoadBalancerSourceRanges(t *testing.T) {
annotations
[
api
.
AnnotationLoadBalancerSourceRangesKey
]
=
v
annotations
[
api
.
AnnotationLoadBalancerSourceRangesKey
]
=
v
svc
:=
api
.
Service
{}
svc
:=
api
.
Service
{}
svc
.
Annotations
=
annotations
svc
.
Annotations
=
annotations
cidrs
,
err
:=
GetLoadBalancerSourceRanges
(
&
svc
)
_
,
err
:=
GetLoadBalancerSourceRanges
(
&
svc
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"Unexpected error parsing: %q"
,
v
)
t
.
Errorf
(
"Unexpected error parsing: %q"
,
v
)
}
}
svc
=
api
.
Service
{}
svc
=
api
.
Service
{}
svc
.
Spec
.
LoadBalancerSourceRanges
=
strings
.
Split
(
v
,
","
)
svc
.
Spec
.
LoadBalancerSourceRanges
=
strings
.
Split
(
v
,
","
)
cidrs
,
err
=
GetLoadBalancerSourceRanges
(
&
svc
)
cidrs
,
err
:
=
GetLoadBalancerSourceRanges
(
&
svc
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"Unexpected error parsing: %q"
,
v
)
t
.
Errorf
(
"Unexpected error parsing: %q"
,
v
)
}
}
...
...
pkg/api/testing/copy_test.go
View file @
04be2c41
...
@@ -69,7 +69,7 @@ func doDeepCopyTest(t *testing.T, kind schema.GroupVersionKind, f *fuzz.Fuzzer)
...
@@ -69,7 +69,7 @@ func doDeepCopyTest(t *testing.T, kind schema.GroupVersionKind, f *fuzz.Fuzzer)
return
return
}
}
if
bytes
.
Compare
(
prefuzzData
.
Bytes
(),
postfuzzData
.
Bytes
())
!=
0
{
if
!
bytes
.
Equal
(
prefuzzData
.
Bytes
(),
postfuzzData
.
Bytes
())
{
t
.
Log
(
diff
.
StringDiff
(
prefuzzData
.
String
(),
postfuzzData
.
String
()))
t
.
Log
(
diff
.
StringDiff
(
prefuzzData
.
String
(),
postfuzzData
.
String
()))
t
.
Errorf
(
"Fuzzing copy modified original of %#v"
,
kind
)
t
.
Errorf
(
"Fuzzing copy modified original of %#v"
,
kind
)
return
return
...
...
pkg/api/testing/serialization_test.go
View file @
04be2c41
...
@@ -387,7 +387,7 @@ func TestObjectWatchFraming(t *testing.T) {
...
@@ -387,7 +387,7 @@ func TestObjectWatchFraming(t *testing.T) {
}
}
sr
=
streaming
.
NewDecoder
(
framer
.
NewFrameReader
(
ioutil
.
NopCloser
(
out
)),
s
)
sr
=
streaming
.
NewDecoder
(
framer
.
NewFrameReader
(
ioutil
.
NopCloser
(
out
)),
s
)
outEvent
:=
&
metav1
.
WatchEvent
{}
outEvent
:=
&
metav1
.
WatchEvent
{}
res
,
_
,
err
=
sr
.
Decode
(
nil
,
outEvent
)
_
,
_
,
err
=
sr
.
Decode
(
nil
,
outEvent
)
if
err
!=
nil
||
outEvent
.
Type
!=
string
(
watch
.
Added
)
{
if
err
!=
nil
||
outEvent
.
Type
!=
string
(
watch
.
Added
)
{
t
.
Fatalf
(
"%v: %#v"
,
err
,
outEvent
)
t
.
Fatalf
(
"%v: %#v"
,
err
,
outEvent
)
}
}
...
...
pkg/api/v1/pod/util_test.go
View file @
04be2c41
...
@@ -604,8 +604,7 @@ func TestUpdatePodCondition(t *testing.T) {
...
@@ -604,8 +604,7 @@ func TestUpdatePodCondition(t *testing.T) {
}
}
for
_
,
test
:=
range
tests
{
for
_
,
test
:=
range
tests
{
var
resultStatus
bool
resultStatus
:=
UpdatePodCondition
(
test
.
status
,
&
test
.
conditions
)
resultStatus
=
UpdatePodCondition
(
test
.
status
,
&
test
.
conditions
)
assert
.
Equal
(
t
,
test
.
expected
,
resultStatus
,
test
.
desc
)
assert
.
Equal
(
t
,
test
.
expected
,
resultStatus
,
test
.
desc
)
}
}
...
...
pkg/api/v1/service/util_test.go
View file @
04be2c41
...
@@ -53,13 +53,13 @@ func TestGetLoadBalancerSourceRanges(t *testing.T) {
...
@@ -53,13 +53,13 @@ func TestGetLoadBalancerSourceRanges(t *testing.T) {
annotations
[
v1
.
AnnotationLoadBalancerSourceRangesKey
]
=
v
annotations
[
v1
.
AnnotationLoadBalancerSourceRangesKey
]
=
v
svc
:=
v1
.
Service
{}
svc
:=
v1
.
Service
{}
svc
.
Annotations
=
annotations
svc
.
Annotations
=
annotations
cidrs
,
err
:=
GetLoadBalancerSourceRanges
(
&
svc
)
_
,
err
:=
GetLoadBalancerSourceRanges
(
&
svc
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"Unexpected error parsing: %q"
,
v
)
t
.
Errorf
(
"Unexpected error parsing: %q"
,
v
)
}
}
svc
=
v1
.
Service
{}
svc
=
v1
.
Service
{}
svc
.
Spec
.
LoadBalancerSourceRanges
=
strings
.
Split
(
v
,
","
)
svc
.
Spec
.
LoadBalancerSourceRanges
=
strings
.
Split
(
v
,
","
)
cidrs
,
err
=
GetLoadBalancerSourceRanges
(
&
svc
)
cidrs
,
err
:
=
GetLoadBalancerSourceRanges
(
&
svc
)
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Errorf
(
"Unexpected error parsing: %q"
,
v
)
t
.
Errorf
(
"Unexpected error parsing: %q"
,
v
)
}
}
...
...
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