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
fa8afc1d
Commit
fa8afc1d
authored
Jan 15, 2018
by
linweibin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused code in UT files in pkg/
parent
5911f87d
Hide whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
18 additions
and
325 deletions
+18
-325
azure_test.go
pkg/cloudprovider/providers/azure/azure_test.go
+0
-50
BUILD
pkg/kubectl/cmd/BUILD
+0
-1
attach_test.go
pkg/kubectl/cmd/attach_test.go
+3
-3
drain_test.go
pkg/kubectl/cmd/drain_test.go
+0
-16
exec_test.go
pkg/kubectl/cmd/exec_test.go
+3
-3
logs_test.go
pkg/kubectl/cmd/logs_test.go
+2
-2
portforward_test.go
pkg/kubectl/cmd/portforward_test.go
+4
-4
get_test.go
pkg/kubectl/cmd/resource/get_test.go
+0
-11
taint_test.go
pkg/kubectl/cmd/taint_test.go
+0
-1
top_pod_test.go
pkg/kubectl/cmd/top_pod_test.go
+0
-2
namespace_test.go
pkg/kubectl/namespace_test.go
+0
-1
rolling_updater_test.go
pkg/kubectl/rolling_updater_test.go
+0
-1
BUILD
pkg/kubelet/cm/cpumanager/BUILD
+0
-1
cpu_manager_test.go
pkg/kubelet/cm/cpumanager/cpu_manager_test.go
+0
-37
manager_test.go
pkg/kubelet/cm/deviceplugin/manager_test.go
+0
-5
helpers_test.go
pkg/kubelet/eviction/helpers_test.go
+2
-16
kubelet_test.go
pkg/kubelet/kubelet_test.go
+0
-2
kuberuntime_gc_test.go
pkg/kubelet/kuberuntime/kuberuntime_gc_test.go
+0
-1
kuberuntime_manager_test.go
pkg/kubelet/kuberuntime/kuberuntime_manager_test.go
+0
-6
remote_runtime_test.go
pkg/kubelet/remote/remote_runtime_test.go
+0
-7
fake_rkt_interface_test.go
pkg/kubelet/rkt/fake_rkt_interface_test.go
+0
-1
cri_stats_provider_test.go
pkg/kubelet/stats/cri_stats_provider_test.go
+0
-1
stats_provider_test.go
pkg/kubelet/stats/stats_provider_test.go
+0
-1
BUILD
pkg/master/BUILD
+0
-5
master_test.go
pkg/master/master_test.go
+0
-31
humanreadable_test.go
pkg/printers/humanreadable_test.go
+0
-11
describe_test.go
pkg/printers/internalversion/describe_test.go
+2
-2
storage_test.go
pkg/registry/apps/statefulset/storage/storage_test.go
+0
-11
strategy_test.go
pkg/registry/batch/cronjob/strategy_test.go
+0
-6
storage_test.go
pkg/registry/core/endpoint/storage/storage_test.go
+0
-10
strategy_test.go
pkg/registry/core/event/strategy_test.go
+0
-13
storage_test.go
pkg/registry/core/persistentvolume/storage/storage_test.go
+0
-5
strategy_test.go
pkg/registry/core/pod/strategy_test.go
+0
-5
storage_test.go
pkg/registry/extensions/controller/storage/storage_test.go
+0
-11
storage_test.go
...gistry/policy/poddisruptionbudget/storage/storage_test.go
+0
-11
storage_test.go
pkg/registry/storage/storageclass/storage/storage_test.go
+0
-4
storage_test.go
...registry/storage/volumeattachment/storage/storage_test.go
+0
-4
BUILD
pkg/security/podsecuritypolicy/group/BUILD
+1
-4
mustrunas_test.go
pkg/security/podsecuritypolicy/group/mustrunas_test.go
+0
-2
jwt_test.go
pkg/serviceaccount/jwt_test.go
+0
-11
dbus_test.go
pkg/util/dbus/dbus_test.go
+1
-6
No files found.
pkg/cloudprovider/providers/azure/azure_test.go
View file @
fa8afc1d
...
@@ -1000,23 +1000,6 @@ func getBackendPort(port int32) int32 {
...
@@ -1000,23 +1000,6 @@ func getBackendPort(port int32) int32 {
return
port
+
10000
return
port
+
10000
}
}
func
getTestPublicFipConfigurationProperties
()
network
.
FrontendIPConfigurationPropertiesFormat
{
return
network
.
FrontendIPConfigurationPropertiesFormat
{
PublicIPAddress
:
&
network
.
PublicIPAddress
{
ID
:
to
.
StringPtr
(
"/this/is/a/public/ip/address/id"
)},
}
}
func
getTestInternalFipConfigurationProperties
(
expectedSubnetName
*
string
)
network
.
FrontendIPConfigurationPropertiesFormat
{
var
expectedSubnet
*
network
.
Subnet
if
expectedSubnetName
!=
nil
{
expectedSubnet
=
&
network
.
Subnet
{
Name
:
expectedSubnetName
}
}
return
network
.
FrontendIPConfigurationPropertiesFormat
{
PublicIPAddress
:
&
network
.
PublicIPAddress
{
ID
:
to
.
StringPtr
(
"/this/is/a/public/ip/address/id"
)},
Subnet
:
expectedSubnet
,
}
}
func
getTestService
(
identifier
string
,
proto
v1
.
Protocol
,
requestedPorts
...
int32
)
v1
.
Service
{
func
getTestService
(
identifier
string
,
proto
v1
.
Protocol
,
requestedPorts
...
int32
)
v1
.
Service
{
ports
:=
[]
v1
.
ServicePort
{}
ports
:=
[]
v1
.
ServicePort
{}
for
_
,
port
:=
range
requestedPorts
{
for
_
,
port
:=
range
requestedPorts
{
...
@@ -1056,39 +1039,6 @@ func setLoadBalancerAutoModeAnnotation(service *v1.Service) {
...
@@ -1056,39 +1039,6 @@ func setLoadBalancerAutoModeAnnotation(service *v1.Service) {
setLoadBalancerModeAnnotation
(
service
,
ServiceAnnotationLoadBalancerAutoModeValue
)
setLoadBalancerModeAnnotation
(
service
,
ServiceAnnotationLoadBalancerAutoModeValue
)
}
}
func
getTestLoadBalancer
(
services
...
v1
.
Service
)
network
.
LoadBalancer
{
rules
:=
[]
network
.
LoadBalancingRule
{}
probes
:=
[]
network
.
Probe
{}
for
_
,
service
:=
range
services
{
for
_
,
port
:=
range
service
.
Spec
.
Ports
{
ruleName
:=
getLoadBalancerRuleName
(
&
service
,
port
,
nil
)
rules
=
append
(
rules
,
network
.
LoadBalancingRule
{
Name
:
to
.
StringPtr
(
ruleName
),
LoadBalancingRulePropertiesFormat
:
&
network
.
LoadBalancingRulePropertiesFormat
{
FrontendPort
:
to
.
Int32Ptr
(
port
.
Port
),
BackendPort
:
to
.
Int32Ptr
(
port
.
Port
),
},
})
probes
=
append
(
probes
,
network
.
Probe
{
Name
:
to
.
StringPtr
(
ruleName
),
ProbePropertiesFormat
:
&
network
.
ProbePropertiesFormat
{
Port
:
to
.
Int32Ptr
(
port
.
NodePort
),
},
})
}
}
lb
:=
network
.
LoadBalancer
{
LoadBalancerPropertiesFormat
:
&
network
.
LoadBalancerPropertiesFormat
{
LoadBalancingRules
:
&
rules
,
Probes
:
&
probes
,
},
}
return
lb
}
func
getServiceSourceRanges
(
service
*
v1
.
Service
)
[]
string
{
func
getServiceSourceRanges
(
service
*
v1
.
Service
)
[]
string
{
if
len
(
service
.
Spec
.
LoadBalancerSourceRanges
)
==
0
{
if
len
(
service
.
Spec
.
LoadBalancerSourceRanges
)
==
0
{
if
!
requiresInternalLoadBalancer
(
service
)
{
if
!
requiresInternalLoadBalancer
(
service
)
{
...
...
pkg/kubectl/cmd/BUILD
View file @
fa8afc1d
...
@@ -207,7 +207,6 @@ go_test(
...
@@ -207,7 +207,6 @@ go_test(
importpath = "k8s.io/kubernetes/pkg/kubectl/cmd",
importpath = "k8s.io/kubernetes/pkg/kubectl/cmd",
deps = [
deps = [
"//pkg/api/legacyscheme:go_default_library",
"//pkg/api/legacyscheme:go_default_library",
"//pkg/api/ref:go_default_library",
"//pkg/api/testapi:go_default_library",
"//pkg/api/testapi:go_default_library",
"//pkg/api/testing:go_default_library",
"//pkg/api/testing:go_default_library",
"//pkg/apis/batch:go_default_library",
"//pkg/apis/batch:go_default_library",
...
...
pkg/kubectl/cmd/attach_test.go
View file @
fa8afc1d
...
@@ -286,9 +286,9 @@ func TestAttach(t *testing.T) {
...
@@ -286,9 +286,9 @@ func TestAttach(t *testing.T) {
func
TestAttachWarnings
(
t
*
testing
.
T
)
{
func
TestAttachWarnings
(
t
*
testing
.
T
)
{
version
:=
legacyscheme
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
.
Version
version
:=
legacyscheme
.
Registry
.
GroupOrDie
(
api
.
GroupName
)
.
GroupVersion
.
Version
tests
:=
[]
struct
{
tests
:=
[]
struct
{
name
,
container
,
version
,
podPath
,
fetchPodPath
,
expectedErr
,
expectedOut
string
name
,
container
,
version
,
podPath
,
fetchPodPath
,
expectedErr
string
pod
*
api
.
Pod
pod
*
api
.
Pod
stdin
,
tty
bool
stdin
,
tty
bool
}{
}{
{
{
name
:
"fallback tty if not supported"
,
name
:
"fallback tty if not supported"
,
...
...
pkg/kubectl/cmd/drain_test.go
View file @
fa8afc1d
...
@@ -44,7 +44,6 @@ import (
...
@@ -44,7 +44,6 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/rest/fake"
"k8s.io/client-go/rest/fake"
"k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/api/ref"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/api/testapi"
"k8s.io/kubernetes/pkg/apis/batch"
"k8s.io/kubernetes/pkg/apis/batch"
api
"k8s.io/kubernetes/pkg/apis/core"
api
"k8s.io/kubernetes/pkg/apis/core"
...
@@ -882,18 +881,3 @@ func (m *MyReq) isFor(method string, path string) bool {
...
@@ -882,18 +881,3 @@ func (m *MyReq) isFor(method string, path string) bool {
req
.
URL
.
Path
==
strings
.
Join
([]
string
{
"/apis/extensions/v1beta1"
,
path
},
""
)
||
req
.
URL
.
Path
==
strings
.
Join
([]
string
{
"/apis/extensions/v1beta1"
,
path
},
""
)
||
req
.
URL
.
Path
==
strings
.
Join
([]
string
{
"/apis/batch/v1"
,
path
},
""
))
req
.
URL
.
Path
==
strings
.
Join
([]
string
{
"/apis/batch/v1"
,
path
},
""
))
}
}
func
refJson
(
t
*
testing
.
T
,
o
runtime
.
Object
)
string
{
ref
,
err
:=
ref
.
GetReference
(
legacyscheme
.
Scheme
,
o
)
if
err
!=
nil
{
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
}
_
,
_
,
codec
,
_
:=
cmdtesting
.
NewAPIFactory
()
json
,
err
:=
runtime
.
Encode
(
codec
,
&
api
.
SerializedReference
{
Reference
:
*
ref
})
if
err
!=
nil
{
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
}
return
string
(
json
)
}
pkg/kubectl/cmd/exec_test.go
View file @
fa8afc1d
...
@@ -163,9 +163,9 @@ func TestPodAndContainer(t *testing.T) {
...
@@ -163,9 +163,9 @@ func TestPodAndContainer(t *testing.T) {
func
TestExec
(
t
*
testing
.
T
)
{
func
TestExec
(
t
*
testing
.
T
)
{
version
:=
"v1"
version
:=
"v1"
tests
:=
[]
struct
{
tests
:=
[]
struct
{
name
,
podPath
,
execPath
,
container
string
name
,
podPath
,
execPath
string
pod
*
api
.
Pod
pod
*
api
.
Pod
execErr
bool
execErr
bool
}{
}{
{
{
name
:
"pod exec"
,
name
:
"pod exec"
,
...
...
pkg/kubectl/cmd/logs_test.go
View file @
fa8afc1d
...
@@ -34,8 +34,8 @@ import (
...
@@ -34,8 +34,8 @@ import (
func
TestLog
(
t
*
testing
.
T
)
{
func
TestLog
(
t
*
testing
.
T
)
{
tests
:=
[]
struct
{
tests
:=
[]
struct
{
name
,
version
,
podPath
,
logPath
,
container
string
name
,
version
,
podPath
,
logPath
string
pod
*
api
.
Pod
pod
*
api
.
Pod
}{
}{
{
{
name
:
"v1 - pod log"
,
name
:
"v1 - pod log"
,
...
...
pkg/kubectl/cmd/portforward_test.go
View file @
fa8afc1d
...
@@ -47,10 +47,10 @@ func testPortForward(t *testing.T, flags map[string]string, args []string) {
...
@@ -47,10 +47,10 @@ func testPortForward(t *testing.T, flags map[string]string, args []string) {
version
:=
"v1"
version
:=
"v1"
tests
:=
[]
struct
{
tests
:=
[]
struct
{
name
string
name
string
podPath
,
pfPath
,
container
string
podPath
,
pfPath
string
pod
*
api
.
Pod
pod
*
api
.
Pod
pfErr
bool
pfErr
bool
}{
}{
{
{
name
:
"pod portforward"
,
name
:
"pod portforward"
,
...
...
pkg/kubectl/cmd/resource/get_test.go
View file @
fa8afc1d
...
@@ -83,17 +83,6 @@ func defaultClientConfig() *restclient.Config {
...
@@ -83,17 +83,6 @@ func defaultClientConfig() *restclient.Config {
}
}
}
}
func
defaultClientConfigForVersion
(
version
*
schema
.
GroupVersion
)
*
restclient
.
Config
{
return
&
restclient
.
Config
{
APIPath
:
"/api"
,
ContentConfig
:
restclient
.
ContentConfig
{
NegotiatedSerializer
:
scheme
.
Codecs
,
ContentType
:
runtime
.
ContentTypeJSON
,
GroupVersion
:
version
,
},
}
}
type
testPrinter
struct
{
type
testPrinter
struct
{
Objects
[]
runtime
.
Object
Objects
[]
runtime
.
Object
Err
error
Err
error
...
...
pkg/kubectl/cmd/taint_test.go
View file @
fa8afc1d
...
@@ -84,7 +84,6 @@ func TestTaint(t *testing.T) {
...
@@ -84,7 +84,6 @@ func TestTaint(t *testing.T) {
args
[]
string
args
[]
string
expectFatal
bool
expectFatal
bool
expectTaint
bool
expectTaint
bool
selector
bool
}{
}{
// success cases
// success cases
{
{
...
...
pkg/kubectl/cmd/top_pod_test.go
View file @
fa8afc1d
...
@@ -41,7 +41,6 @@ func TestTopPod(t *testing.T) {
...
@@ -41,7 +41,6 @@ func TestTopPod(t *testing.T) {
testNS
:=
"testns"
testNS
:=
"testns"
testCases
:=
[]
struct
{
testCases
:=
[]
struct
{
name
string
name
string
namespace
string
flags
map
[
string
]
string
flags
map
[
string
]
string
args
[]
string
args
[]
string
expectedPath
string
expectedPath
string
...
@@ -176,7 +175,6 @@ func TestTopPodCustomDefaults(t *testing.T) {
...
@@ -176,7 +175,6 @@ func TestTopPodCustomDefaults(t *testing.T) {
testNS
:=
"custom-namespace"
testNS
:=
"custom-namespace"
testCases
:=
[]
struct
{
testCases
:=
[]
struct
{
name
string
name
string
namespace
string
flags
map
[
string
]
string
flags
map
[
string
]
string
args
[]
string
args
[]
string
expectedPath
string
expectedPath
string
...
...
pkg/kubectl/namespace_test.go
View file @
fa8afc1d
...
@@ -29,7 +29,6 @@ func TestNamespaceGenerate(t *testing.T) {
...
@@ -29,7 +29,6 @@ func TestNamespaceGenerate(t *testing.T) {
params
map
[
string
]
interface
{}
params
map
[
string
]
interface
{}
expected
*
v1
.
Namespace
expected
*
v1
.
Namespace
expectErr
bool
expectErr
bool
index
int
}{
}{
{
{
params
:
map
[
string
]
interface
{}{
params
:
map
[
string
]
interface
{}{
...
...
pkg/kubectl/rolling_updater_test.go
View file @
fa8afc1d
...
@@ -1260,7 +1260,6 @@ func TestFindSourceController(t *testing.T) {
...
@@ -1260,7 +1260,6 @@ func TestFindSourceController(t *testing.T) {
tests
:=
[]
struct
{
tests
:=
[]
struct
{
list
*
api
.
ReplicationControllerList
list
*
api
.
ReplicationControllerList
expectedController
*
api
.
ReplicationController
expectedController
*
api
.
ReplicationController
err
error
name
string
name
string
expectError
bool
expectError
bool
}{
}{
...
...
pkg/kubelet/cm/cpumanager/BUILD
View file @
fa8afc1d
...
@@ -47,7 +47,6 @@ go_test(
...
@@ -47,7 +47,6 @@ go_test(
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/types:go_default_library",
],
],
)
)
...
...
pkg/kubelet/cm/cpumanager/cpu_manager_test.go
View file @
fa8afc1d
...
@@ -28,7 +28,6 @@ import (
...
@@ -28,7 +28,6 @@ import (
"k8s.io/api/core/v1"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/api/resource"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/types"
runtimeapi
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
runtimeapi
"k8s.io/kubernetes/pkg/kubelet/apis/cri/v1alpha1/runtime"
"k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state"
"k8s.io/kubernetes/pkg/kubelet/cm/cpumanager/state"
...
@@ -118,28 +117,6 @@ func (psp mockPodStatusProvider) GetPodStatus(uid types.UID) (v1.PodStatus, bool
...
@@ -118,28 +117,6 @@ func (psp mockPodStatusProvider) GetPodStatus(uid types.UID) (v1.PodStatus, bool
return
psp
.
podStatus
,
psp
.
found
return
psp
.
podStatus
,
psp
.
found
}
}
type
mockPodKiller
struct
{
killedPods
[]
*
v1
.
Pod
}
func
(
f
*
mockPodKiller
)
killPodNow
(
pod
*
v1
.
Pod
,
status
v1
.
PodStatus
,
gracePeriodOverride
*
int64
)
error
{
f
.
killedPods
=
append
(
f
.
killedPods
,
pod
)
return
nil
}
type
mockPodProvider
struct
{
pods
[]
*
v1
.
Pod
}
func
(
f
*
mockPodProvider
)
getPods
()
[]
*
v1
.
Pod
{
return
f
.
pods
}
type
mockRecorder
struct
{}
func
(
r
*
mockRecorder
)
Eventf
(
object
runtime
.
Object
,
eventtype
,
reason
,
messageFmt
string
,
args
...
interface
{})
{
}
func
makePod
(
cpuRequest
,
cpuLimit
string
)
*
v1
.
Pod
{
func
makePod
(
cpuRequest
,
cpuLimit
string
)
*
v1
.
Pod
{
return
&
v1
.
Pod
{
return
&
v1
.
Pod
{
Spec
:
v1
.
PodSpec
{
Spec
:
v1
.
PodSpec
{
...
@@ -161,20 +138,6 @@ func makePod(cpuRequest, cpuLimit string) *v1.Pod {
...
@@ -161,20 +138,6 @@ func makePod(cpuRequest, cpuLimit string) *v1.Pod {
}
}
}
}
// CpuAllocatable must be <= CpuCapacity
func
prepareCPUNodeStatus
(
CPUCapacity
,
CPUAllocatable
string
)
v1
.
NodeStatus
{
nodestatus
:=
v1
.
NodeStatus
{
Capacity
:
make
(
v1
.
ResourceList
,
1
),
Allocatable
:
make
(
v1
.
ResourceList
,
1
),
}
cpucap
,
_
:=
resource
.
ParseQuantity
(
CPUCapacity
)
cpuall
,
_
:=
resource
.
ParseQuantity
(
CPUAllocatable
)
nodestatus
.
Capacity
[
v1
.
ResourceCPU
]
=
cpucap
nodestatus
.
Allocatable
[
v1
.
ResourceCPU
]
=
cpuall
return
nodestatus
}
func
TestCPUManagerAdd
(
t
*
testing
.
T
)
{
func
TestCPUManagerAdd
(
t
*
testing
.
T
)
{
testCases
:=
[]
struct
{
testCases
:=
[]
struct
{
description
string
description
string
...
...
pkg/kubelet/cm/deviceplugin/manager_test.go
View file @
fa8afc1d
...
@@ -233,11 +233,6 @@ func TestUpdateCapacityAllocatable(t *testing.T) {
...
@@ -233,11 +233,6 @@ func TestUpdateCapacityAllocatable(t *testing.T) {
}
}
type
stringPairType
struct
{
value1
string
value2
string
}
func
constructDevices
(
devices
[]
string
)
sets
.
String
{
func
constructDevices
(
devices
[]
string
)
sets
.
String
{
ret
:=
sets
.
NewString
()
ret
:=
sets
.
NewString
()
for
_
,
dev
:=
range
devices
{
for
_
,
dev
:=
range
devices
{
...
...
pkg/kubelet/eviction/helpers_test.go
View file @
fa8afc1d
...
@@ -1645,7 +1645,7 @@ func TestGetStarvedResources(t *testing.T) {
...
@@ -1645,7 +1645,7 @@ func TestGetStarvedResources(t *testing.T) {
}
}
}
}
func
t
estParsePercentage
(
t
*
testing
.
T
)
{
func
T
estParsePercentage
(
t
*
testing
.
T
)
{
testCases
:=
map
[
string
]
struct
{
testCases
:=
map
[
string
]
struct
{
hasError
bool
hasError
bool
value
float32
value
float32
...
@@ -1674,7 +1674,7 @@ func testParsePercentage(t *testing.T) {
...
@@ -1674,7 +1674,7 @@ func testParsePercentage(t *testing.T) {
}
}
}
}
func
t
estCompareThresholdValue
(
t
*
testing
.
T
)
{
func
T
estCompareThresholdValue
(
t
*
testing
.
T
)
{
testCases
:=
[]
struct
{
testCases
:=
[]
struct
{
a
,
b
evictionapi
.
ThresholdValue
a
,
b
evictionapi
.
ThresholdValue
equal
bool
equal
bool
...
@@ -1831,20 +1831,6 @@ func newResourceList(cpu, memory, disk string) v1.ResourceList {
...
@@ -1831,20 +1831,6 @@ func newResourceList(cpu, memory, disk string) v1.ResourceList {
return
res
return
res
}
}
func
newEphemeralStorageResourceList
(
ephemeral
,
cpu
,
memory
string
)
v1
.
ResourceList
{
res
:=
v1
.
ResourceList
{}
if
ephemeral
!=
""
{
res
[
v1
.
ResourceEphemeralStorage
]
=
resource
.
MustParse
(
ephemeral
)
}
if
cpu
!=
""
{
res
[
v1
.
ResourceCPU
]
=
resource
.
MustParse
(
cpu
)
}
if
memory
!=
""
{
res
[
v1
.
ResourceMemory
]
=
resource
.
MustParse
(
"1Mi"
)
}
return
res
}
func
newResourceRequirements
(
requests
,
limits
v1
.
ResourceList
)
v1
.
ResourceRequirements
{
func
newResourceRequirements
(
requests
,
limits
v1
.
ResourceList
)
v1
.
ResourceRequirements
{
res
:=
v1
.
ResourceRequirements
{}
res
:=
v1
.
ResourceRequirements
{}
res
.
Requests
=
requests
res
.
Requests
=
requests
...
...
pkg/kubelet/kubelet_test.go
View file @
fa8afc1d
...
@@ -334,8 +334,6 @@ func newTestPods(count int) []*v1.Pod {
...
@@ -334,8 +334,6 @@ func newTestPods(count int) []*v1.Pod {
return
pods
return
pods
}
}
var
emptyPodUIDs
map
[
types
.
UID
]
kubetypes
.
SyncPodType
func
TestSyncLoopAbort
(
t
*
testing
.
T
)
{
func
TestSyncLoopAbort
(
t
*
testing
.
T
)
{
testKubelet
:=
newTestKubelet
(
t
,
false
/* controllerAttachDetachEnabled */
)
testKubelet
:=
newTestKubelet
(
t
,
false
/* controllerAttachDetachEnabled */
)
defer
testKubelet
.
Cleanup
()
defer
testKubelet
.
Cleanup
()
...
...
pkg/kubelet/kuberuntime/kuberuntime_gc_test.go
View file @
fa8afc1d
...
@@ -65,7 +65,6 @@ func TestSandboxGC(t *testing.T) {
...
@@ -65,7 +65,6 @@ func TestSandboxGC(t *testing.T) {
description
string
// description of the test case
description
string
// description of the test case
sandboxes
[]
sandboxTemplate
// templates of sandboxes
sandboxes
[]
sandboxTemplate
// templates of sandboxes
containers
[]
containerTemplate
// templates of containers
containers
[]
containerTemplate
// templates of containers
minAge
time
.
Duration
// sandboxMinGCAge
remain
[]
int
// template indexes of remaining sandboxes
remain
[]
int
// template indexes of remaining sandboxes
evictTerminatedPods
bool
evictTerminatedPods
bool
}{
}{
...
...
pkg/kubelet/kuberuntime/kuberuntime_manager_test.go
View file @
fa8afc1d
...
@@ -225,12 +225,6 @@ func verifyFakeContainerList(fakeRuntime *apitest.FakeRuntimeService, expected s
...
@@ -225,12 +225,6 @@ func verifyFakeContainerList(fakeRuntime *apitest.FakeRuntimeService, expected s
return
actual
,
actual
.
Equal
(
expected
)
return
actual
,
actual
.
Equal
(
expected
)
}
}
type
containerRecord
struct
{
container
*
v1
.
Container
attempt
uint32
state
runtimeapi
.
ContainerState
}
// Only extract the fields of interests.
// Only extract the fields of interests.
type
cRecord
struct
{
type
cRecord
struct
{
name
string
name
string
...
...
pkg/kubelet/remote/remote_runtime_test.go
View file @
fa8afc1d
...
@@ -50,13 +50,6 @@ func createRemoteRuntimeService(endpoint string, t *testing.T) internalapi.Runti
...
@@ -50,13 +50,6 @@ func createRemoteRuntimeService(endpoint string, t *testing.T) internalapi.Runti
return
runtimeService
return
runtimeService
}
}
func
createRemoteImageService
(
endpoint
string
,
t
*
testing
.
T
)
internalapi
.
ImageManagerService
{
imageService
,
err
:=
NewRemoteImageService
(
endpoint
,
defaultConnectionTimeout
)
assert
.
NoError
(
t
,
err
)
return
imageService
}
func
TestVersion
(
t
*
testing
.
T
)
{
func
TestVersion
(
t
*
testing
.
T
)
{
fakeRuntime
,
endpoint
:=
createAndStartFakeRemoteRuntime
(
t
)
fakeRuntime
,
endpoint
:=
createAndStartFakeRemoteRuntime
(
t
)
defer
fakeRuntime
.
Stop
()
defer
fakeRuntime
.
Stop
()
...
...
pkg/kubelet/rkt/fake_rkt_interface_test.go
View file @
fa8afc1d
...
@@ -195,7 +195,6 @@ func (f *fakePodDeletionProvider) IsPodDeleted(uid types.UID) bool {
...
@@ -195,7 +195,6 @@ func (f *fakePodDeletionProvider) IsPodDeleted(uid types.UID) bool {
type
fakeUnitGetter
struct
{
type
fakeUnitGetter
struct
{
networkNamespace
kubecontainer
.
ContainerID
networkNamespace
kubecontainer
.
ContainerID
callServices
[]
string
}
}
func
newfakeUnitGetter
()
*
fakeUnitGetter
{
func
newfakeUnitGetter
()
*
fakeUnitGetter
{
...
...
pkg/kubelet/stats/cri_stats_provider_test.go
View file @
fa8afc1d
...
@@ -38,7 +38,6 @@ import (
...
@@ -38,7 +38,6 @@ import (
func
TestCRIListPodStats
(
t
*
testing
.
T
)
{
func
TestCRIListPodStats
(
t
*
testing
.
T
)
{
const
(
const
(
seedRoot
=
0
seedRoot
=
0
seedRuntime
=
100
seedKubelet
=
200
seedKubelet
=
200
seedMisc
=
300
seedMisc
=
300
seedSandbox0
=
1000
seedSandbox0
=
1000
...
...
pkg/kubelet/stats/stats_provider_test.go
View file @
fa8afc1d
...
@@ -59,7 +59,6 @@ const (
...
@@ -59,7 +59,6 @@ const (
offsetFsTotalUsageBytes
offsetFsTotalUsageBytes
offsetFsBaseUsageBytes
offsetFsBaseUsageBytes
offsetFsInodeUsage
offsetFsInodeUsage
offsetVolume
)
)
var
(
var
(
...
...
pkg/master/BUILD
View file @
fa8afc1d
...
@@ -145,13 +145,8 @@ go_test(
...
@@ -145,13 +145,8 @@ go_test(
"//vendor/github.com/go-openapi/strfmt:go_default_library",
"//vendor/github.com/go-openapi/strfmt:go_default_library",
"//vendor/github.com/go-openapi/validate:go_default_library",
"//vendor/github.com/go-openapi/validate:go_default_library",
"//vendor/github.com/stretchr/testify/assert:go_default_library",
"//vendor/github.com/stretchr/testify/assert:go_default_library",
"//vendor/k8s.io/api/apps/v1beta1:go_default_library",
"//vendor/k8s.io/api/autoscaling/v1:go_default_library",
"//vendor/k8s.io/api/batch/v1:go_default_library",
"//vendor/k8s.io/api/batch/v1beta1:go_default_library",
"//vendor/k8s.io/api/certificates/v1beta1:go_default_library",
"//vendor/k8s.io/api/certificates/v1beta1:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/api/core/v1:go_default_library",
"//vendor/k8s.io/api/extensions/v1beta1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
"//vendor/k8s.io/apimachinery/pkg/runtime/schema:go_default_library",
...
...
pkg/master/master_test.go
View file @
fa8afc1d
...
@@ -27,13 +27,8 @@ import (
...
@@ -27,13 +27,8 @@ import (
"strings"
"strings"
"testing"
"testing"
appsapiv1beta1
"k8s.io/api/apps/v1beta1"
autoscalingapiv1
"k8s.io/api/autoscaling/v1"
batchapiv1
"k8s.io/api/batch/v1"
batchapiv1beta1
"k8s.io/api/batch/v1beta1"
certificatesapiv1beta1
"k8s.io/api/certificates/v1beta1"
certificatesapiv1beta1
"k8s.io/api/certificates/v1beta1"
apiv1
"k8s.io/api/core/v1"
apiv1
"k8s.io/api/core/v1"
extensionsapiv1beta1
"k8s.io/api/extensions/v1beta1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/schema"
...
@@ -194,32 +189,6 @@ func newMaster(t *testing.T) (*Master, *etcdtesting.EtcdTestServer, Config, *ass
...
@@ -194,32 +189,6 @@ func newMaster(t *testing.T) (*Master, *etcdtesting.EtcdTestServer, Config, *ass
return
master
,
etcdserver
,
config
,
assert
return
master
,
etcdserver
,
config
,
assert
}
}
// limitedAPIResourceConfigSource only enables the core group, the extensions group, the batch group, and the autoscaling group.
func
limitedAPIResourceConfigSource
()
*
serverstorage
.
ResourceConfig
{
ret
:=
serverstorage
.
NewResourceConfig
()
ret
.
EnableVersions
(
apiv1
.
SchemeGroupVersion
,
extensionsapiv1beta1
.
SchemeGroupVersion
,
batchapiv1
.
SchemeGroupVersion
,
batchapiv1beta1
.
SchemeGroupVersion
,
appsapiv1beta1
.
SchemeGroupVersion
,
autoscalingapiv1
.
SchemeGroupVersion
,
)
return
ret
}
// newLimitedMaster only enables the core group, the extensions group, the batch group, and the autoscaling group.
func
newLimitedMaster
(
t
*
testing
.
T
)
(
*
Master
,
*
etcdtesting
.
EtcdTestServer
,
Config
,
*
assert
.
Assertions
)
{
etcdserver
,
config
,
sharedInformers
,
assert
:=
setUp
(
t
)
config
.
ExtraConfig
.
APIResourceConfigSource
=
limitedAPIResourceConfigSource
()
master
,
err
:=
config
.
Complete
(
sharedInformers
)
.
New
(
genericapiserver
.
EmptyDelegate
)
if
err
!=
nil
{
t
.
Fatalf
(
"Error in bringing up the master: %v"
,
err
)
}
return
master
,
etcdserver
,
config
,
assert
}
// TestVersion tests /version
// TestVersion tests /version
func
TestVersion
(
t
*
testing
.
T
)
{
func
TestVersion
(
t
*
testing
.
T
)
{
s
,
etcdserver
,
_
,
_
:=
newMaster
(
t
)
s
,
etcdserver
,
_
,
_
:=
newMaster
(
t
)
...
...
pkg/printers/humanreadable_test.go
View file @
fa8afc1d
...
@@ -45,17 +45,6 @@ func testPrintNamespace(obj *api.Namespace, options PrintOptions) ([]metav1alpha
...
@@ -45,17 +45,6 @@ func testPrintNamespace(obj *api.Namespace, options PrintOptions) ([]metav1alpha
return
[]
metav1alpha1
.
TableRow
{
row
},
nil
return
[]
metav1alpha1
.
TableRow
{
row
},
nil
}
}
func
testPrintNamespaceList
(
list
*
api
.
NamespaceList
,
options
PrintOptions
)
([]
metav1alpha1
.
TableRow
,
error
)
{
rows
:=
make
([]
metav1alpha1
.
TableRow
,
0
,
len
(
list
.
Items
))
for
i
:=
range
list
.
Items
{
r
,
err
:=
testPrintNamespace
(
&
list
.
Items
[
i
],
options
)
if
err
!=
nil
{
return
nil
,
err
}
rows
=
append
(
rows
,
r
...
)
}
return
rows
,
nil
}
func
TestPrintRowsForHandlerEntry
(
t
*
testing
.
T
)
{
func
TestPrintRowsForHandlerEntry
(
t
*
testing
.
T
)
{
printFunc
:=
reflect
.
ValueOf
(
testPrintNamespace
)
printFunc
:=
reflect
.
ValueOf
(
testPrintNamespace
)
...
...
pkg/printers/internalversion/describe_test.go
View file @
fa8afc1d
...
@@ -783,8 +783,8 @@ func TestDefaultDescribers(t *testing.T) {
...
@@ -783,8 +783,8 @@ func TestDefaultDescribers(t *testing.T) {
func
TestGetPodsTotalRequests
(
t
*
testing
.
T
)
{
func
TestGetPodsTotalRequests
(
t
*
testing
.
T
)
{
testCases
:=
[]
struct
{
testCases
:=
[]
struct
{
pods
*
api
.
PodList
pods
*
api
.
PodList
expectedReqs
,
expectedLimits
map
[
api
.
ResourceName
]
resource
.
Quantity
expectedReqs
map
[
api
.
ResourceName
]
resource
.
Quantity
}{
}{
{
{
pods
:
&
api
.
PodList
{
pods
:
&
api
.
PodList
{
...
...
pkg/registry/apps/statefulset/storage/storage_test.go
View file @
fa8afc1d
...
@@ -44,17 +44,6 @@ func newStorage(t *testing.T) (StatefulSetStorage, *etcdtesting.EtcdTestServer)
...
@@ -44,17 +44,6 @@ func newStorage(t *testing.T) (StatefulSetStorage, *etcdtesting.EtcdTestServer)
return
storage
,
server
return
storage
,
server
}
}
// createStatefulSet is a helper function that returns a StatefulSet with the updated resource version.
func
createStatefulSet
(
storage
*
REST
,
ps
apps
.
StatefulSet
,
t
*
testing
.
T
)
(
apps
.
StatefulSet
,
error
)
{
ctx
:=
genericapirequest
.
WithNamespace
(
genericapirequest
.
NewContext
(),
ps
.
Namespace
)
obj
,
err
:=
storage
.
Create
(
ctx
,
&
ps
,
rest
.
ValidateAllObjectFunc
,
false
)
if
err
!=
nil
{
t
.
Errorf
(
"Failed to create StatefulSet, %v"
,
err
)
}
newPS
:=
obj
.
(
*
apps
.
StatefulSet
)
return
*
newPS
,
nil
}
func
validNewStatefulSet
()
*
apps
.
StatefulSet
{
func
validNewStatefulSet
()
*
apps
.
StatefulSet
{
return
&
apps
.
StatefulSet
{
return
&
apps
.
StatefulSet
{
ObjectMeta
:
metav1
.
ObjectMeta
{
ObjectMeta
:
metav1
.
ObjectMeta
{
...
...
pkg/registry/batch/cronjob/strategy_test.go
View file @
fa8afc1d
...
@@ -26,12 +26,6 @@ import (
...
@@ -26,12 +26,6 @@ import (
api
"k8s.io/kubernetes/pkg/apis/core"
api
"k8s.io/kubernetes/pkg/apis/core"
)
)
func
newBool
(
a
bool
)
*
bool
{
r
:=
new
(
bool
)
*
r
=
a
return
r
}
func
TestCronJobStrategy
(
t
*
testing
.
T
)
{
func
TestCronJobStrategy
(
t
*
testing
.
T
)
{
ctx
:=
genericapirequest
.
NewDefaultContext
()
ctx
:=
genericapirequest
.
NewDefaultContext
()
if
!
Strategy
.
NamespaceScoped
()
{
if
!
Strategy
.
NamespaceScoped
()
{
...
...
pkg/registry/core/endpoint/storage/storage_test.go
View file @
fa8afc1d
...
@@ -54,16 +54,6 @@ func validNewEndpoints() *api.Endpoints {
...
@@ -54,16 +54,6 @@ func validNewEndpoints() *api.Endpoints {
}
}
}
}
func
validChangedEndpoints
()
*
api
.
Endpoints
{
endpoints
:=
validNewEndpoints
()
endpoints
.
ResourceVersion
=
"1"
endpoints
.
Subsets
=
[]
api
.
EndpointSubset
{{
Addresses
:
[]
api
.
EndpointAddress
{{
IP
:
"1.2.3.4"
},
{
IP
:
"5.6.7.8"
}},
Ports
:
[]
api
.
EndpointPort
{{
Port
:
80
,
Protocol
:
"TCP"
}},
}}
return
endpoints
}
func
TestCreate
(
t
*
testing
.
T
)
{
func
TestCreate
(
t
*
testing
.
T
)
{
storage
,
server
:=
newStorage
(
t
)
storage
,
server
:=
newStorage
(
t
)
defer
server
.
Terminate
(
t
)
defer
server
.
Terminate
(
t
)
...
...
pkg/registry/core/event/strategy_test.go
View file @
fa8afc1d
...
@@ -31,19 +31,6 @@ import (
...
@@ -31,19 +31,6 @@ import (
_
"k8s.io/kubernetes/pkg/api/testapi"
_
"k8s.io/kubernetes/pkg/api/testapi"
)
)
func
testEvent
(
name
string
)
*
api
.
Event
{
return
&
api
.
Event
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
name
,
Namespace
:
"default"
,
},
InvolvedObject
:
api
.
ObjectReference
{
Namespace
:
"default"
,
},
Reason
:
"forTesting"
,
}
}
func
TestGetAttrs
(
t
*
testing
.
T
)
{
func
TestGetAttrs
(
t
*
testing
.
T
)
{
eventA
:=
&
api
.
Event
{
eventA
:=
&
api
.
Event
{
ObjectMeta
:
metav1
.
ObjectMeta
{
ObjectMeta
:
metav1
.
ObjectMeta
{
...
...
pkg/registry/core/persistentvolume/storage/storage_test.go
View file @
fa8afc1d
...
@@ -77,11 +77,6 @@ func validNewPersistentVolume(name string) *api.PersistentVolume {
...
@@ -77,11 +77,6 @@ func validNewPersistentVolume(name string) *api.PersistentVolume {
return
pv
return
pv
}
}
func
validChangedPersistentVolume
()
*
api
.
PersistentVolume
{
pv
:=
validNewPersistentVolume
(
"foo"
)
return
pv
}
func
TestCreate
(
t
*
testing
.
T
)
{
func
TestCreate
(
t
*
testing
.
T
)
{
storage
,
_
,
server
:=
newStorage
(
t
)
storage
,
_
,
server
:=
newStorage
(
t
)
defer
server
.
Terminate
(
t
)
defer
server
.
Terminate
(
t
)
...
...
pkg/registry/core/pod/strategy_test.go
View file @
fa8afc1d
...
@@ -138,11 +138,6 @@ func getResourceList(cpu, memory string) api.ResourceList {
...
@@ -138,11 +138,6 @@ func getResourceList(cpu, memory string) api.ResourceList {
return
res
return
res
}
}
func
addResource
(
rName
,
value
string
,
rl
api
.
ResourceList
)
api
.
ResourceList
{
rl
[
api
.
ResourceName
(
rName
)]
=
resource
.
MustParse
(
value
)
return
rl
}
func
getResourceRequirements
(
requests
,
limits
api
.
ResourceList
)
api
.
ResourceRequirements
{
func
getResourceRequirements
(
requests
,
limits
api
.
ResourceList
)
api
.
ResourceRequirements
{
res
:=
api
.
ResourceRequirements
{}
res
:=
api
.
ResourceRequirements
{}
res
.
Requests
=
requests
res
.
Requests
=
requests
...
...
pkg/registry/extensions/controller/storage/storage_test.go
View file @
fa8afc1d
...
@@ -74,17 +74,6 @@ var validController = api.ReplicationController{
...
@@ -74,17 +74,6 @@ var validController = api.ReplicationController{
Spec
:
validControllerSpec
,
Spec
:
validControllerSpec
,
}
}
var
validScale
=
autoscaling
.
Scale
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"foo"
,
Namespace
:
"test"
},
Spec
:
autoscaling
.
ScaleSpec
{
Replicas
:
validReplicas
,
},
Status
:
autoscaling
.
ScaleStatus
{
Replicas
:
0
,
Selector
:
"a=b"
,
},
}
func
TestGet
(
t
*
testing
.
T
)
{
func
TestGet
(
t
*
testing
.
T
)
{
storage
,
_
,
si
,
destroyFunc
:=
newStorage
(
t
)
storage
,
_
,
si
,
destroyFunc
:=
newStorage
(
t
)
defer
destroyFunc
()
defer
destroyFunc
()
...
...
pkg/registry/policy/poddisruptionbudget/storage/storage_test.go
View file @
fa8afc1d
...
@@ -39,17 +39,6 @@ func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer)
...
@@ -39,17 +39,6 @@ func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer)
return
podDisruptionBudgetStorage
,
statusStorage
,
server
return
podDisruptionBudgetStorage
,
statusStorage
,
server
}
}
// createPodDisruptionBudget is a helper function that returns a PodDisruptionBudget with the updated resource version.
func
createPodDisruptionBudget
(
storage
*
REST
,
pdb
policy
.
PodDisruptionBudget
,
t
*
testing
.
T
)
(
policy
.
PodDisruptionBudget
,
error
)
{
ctx
:=
genericapirequest
.
WithNamespace
(
genericapirequest
.
NewContext
(),
pdb
.
Namespace
)
obj
,
err
:=
storage
.
Create
(
ctx
,
&
pdb
,
rest
.
ValidateAllObjectFunc
,
false
)
if
err
!=
nil
{
t
.
Errorf
(
"Failed to create PodDisruptionBudget, %v"
,
err
)
}
newPS
:=
obj
.
(
*
policy
.
PodDisruptionBudget
)
return
*
newPS
,
nil
}
func
validNewPodDisruptionBudget
()
*
policy
.
PodDisruptionBudget
{
func
validNewPodDisruptionBudget
()
*
policy
.
PodDisruptionBudget
{
minAvailable
:=
intstr
.
FromInt
(
7
)
minAvailable
:=
intstr
.
FromInt
(
7
)
return
&
policy
.
PodDisruptionBudget
{
return
&
policy
.
PodDisruptionBudget
{
...
...
pkg/registry/storage/storageclass/storage/storage_test.go
View file @
fa8afc1d
...
@@ -57,10 +57,6 @@ func validNewStorageClass(name string) *storageapi.StorageClass {
...
@@ -57,10 +57,6 @@ func validNewStorageClass(name string) *storageapi.StorageClass {
}
}
}
}
func
validChangedStorageClass
()
*
storageapi
.
StorageClass
{
return
validNewStorageClass
(
"foo"
)
}
func
TestCreate
(
t
*
testing
.
T
)
{
func
TestCreate
(
t
*
testing
.
T
)
{
storage
,
server
:=
newStorage
(
t
)
storage
,
server
:=
newStorage
(
t
)
defer
server
.
Terminate
(
t
)
defer
server
.
Terminate
(
t
)
...
...
pkg/registry/storage/volumeattachment/storage/storage_test.go
View file @
fa8afc1d
...
@@ -60,10 +60,6 @@ func validNewVolumeAttachment(name string) *storageapi.VolumeAttachment {
...
@@ -60,10 +60,6 @@ func validNewVolumeAttachment(name string) *storageapi.VolumeAttachment {
}
}
}
}
func
validChangedVolumeAttachment
()
*
storageapi
.
VolumeAttachment
{
return
validNewVolumeAttachment
(
"foo"
)
}
func
TestCreate
(
t
*
testing
.
T
)
{
func
TestCreate
(
t
*
testing
.
T
)
{
if
*
testapi
.
Storage
.
GroupVersion
()
!=
storageapiv1alpha1
.
SchemeGroupVersion
{
if
*
testapi
.
Storage
.
GroupVersion
()
!=
storageapiv1alpha1
.
SchemeGroupVersion
{
// skip the test for all versions exception v1alpha1
// skip the test for all versions exception v1alpha1
...
...
pkg/security/podsecuritypolicy/group/BUILD
View file @
fa8afc1d
...
@@ -31,10 +31,7 @@ go_test(
...
@@ -31,10 +31,7 @@ go_test(
],
],
embed = [":go_default_library"],
embed = [":go_default_library"],
importpath = "k8s.io/kubernetes/pkg/security/podsecuritypolicy/group",
importpath = "k8s.io/kubernetes/pkg/security/podsecuritypolicy/group",
deps = [
deps = ["//pkg/apis/extensions:go_default_library"],
"//pkg/apis/core:go_default_library",
"//pkg/apis/extensions:go_default_library",
],
)
)
filegroup(
filegroup(
...
...
pkg/security/podsecuritypolicy/group/mustrunas_test.go
View file @
fa8afc1d
...
@@ -17,7 +17,6 @@ limitations under the License.
...
@@ -17,7 +17,6 @@ limitations under the License.
package
group
package
group
import
(
import
(
api
"k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/apis/extensions"
"k8s.io/kubernetes/pkg/apis/extensions"
"testing"
"testing"
)
)
...
@@ -110,7 +109,6 @@ func TestGenerate(t *testing.T) {
...
@@ -110,7 +109,6 @@ func TestGenerate(t *testing.T) {
func
TestValidate
(
t
*
testing
.
T
)
{
func
TestValidate
(
t
*
testing
.
T
)
{
tests
:=
map
[
string
]
struct
{
tests
:=
map
[
string
]
struct
{
ranges
[]
extensions
.
GroupIDRange
ranges
[]
extensions
.
GroupIDRange
pod
*
api
.
Pod
groups
[]
int64
groups
[]
int64
pass
bool
pass
bool
}{
}{
...
...
pkg/serviceaccount/jwt_test.go
View file @
fa8afc1d
...
@@ -80,17 +80,6 @@ X024wzbiw1q07jFCyfQmODzURAx1VNT7QVUMdz/N8vy47/H40AZJ
...
@@ -80,17 +80,6 @@ X024wzbiw1q07jFCyfQmODzURAx1VNT7QVUMdz/N8vy47/H40AZJ
-----END RSA PRIVATE KEY-----
-----END RSA PRIVATE KEY-----
`
`
// openssl ecparam -name prime256v1 -genkey -out ecdsa256params.pem
const
ecdsaPrivateKeyWithParams
=
`-----BEGIN EC PARAMETERS-----
BggqhkjOPQMBBw==
-----END EC PARAMETERS-----
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIJ9LWDj3ZWe9CksPV7mZjD2dYXG9icfzxadCRwd3vr1toAoGCCqGSM49
AwEHoUQDQgAEaLNEpzbaaNTCkKjBVj7sxpfJ1ifJQGNvcck4nrzcwFRuujwVDDJh
95iIGwKCQeSg+yhdN6Q/p2XaxNIZlYmUhg==
-----END EC PRIVATE KEY-----
`
// openssl ecparam -name prime256v1 -genkey -noout -out ecdsa256.pem
// openssl ecparam -name prime256v1 -genkey -noout -out ecdsa256.pem
const
ecdsaPrivateKey
=
`-----BEGIN EC PRIVATE KEY-----
const
ecdsaPrivateKey
=
`-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIEZmTmUhuanLjPA2CLquXivuwBDHTt5XYwgIr/kA1LtRoAoGCCqGSM49
MHcCAQEEIEZmTmUhuanLjPA2CLquXivuwBDHTt5XYwgIr/kA1LtRoAoGCCqGSM49
...
...
pkg/util/dbus/dbus_test.go
View file @
fa8afc1d
...
@@ -25,21 +25,16 @@ import (
...
@@ -25,21 +25,16 @@ import (
)
)
const
(
const
(
DBusNameFlagAllowReplacement
uint32
=
1
<<
(
iota
+
1
)
DBusNameFlagDoNotQueue
uint32
=
1
<<
(
iota
+
1
)
DBusNameFlagReplaceExisting
DBusNameFlagDoNotQueue
)
)
const
(
const
(
DBusRequestNameReplyPrimaryOwner
uint32
=
iota
+
1
DBusRequestNameReplyPrimaryOwner
uint32
=
iota
+
1
DBusRequestNameReplyInQueue
DBusRequestNameReplyExists
DBusRequestNameReplyAlreadyOwner
DBusRequestNameReplyAlreadyOwner
)
)
const
(
const
(
DBusReleaseNameReplyReleased
uint32
=
iota
+
1
DBusReleaseNameReplyReleased
uint32
=
iota
+
1
DBusReleaseNameReplyNonExistent
DBusReleaseNameReplyNotOwner
DBusReleaseNameReplyNotOwner
)
)
...
...
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