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
6681835b
Unverified
Commit
6681835b
authored
Mar 28, 2017
by
Christoph Blecker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix gofmt errors
parent
b4c71b1f
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
51 additions
and
51 deletions
+51
-51
main.go
cmd/libs/go2idl/client-gen/main.go
+1
-1
garbagecollector_test.go
pkg/controller/garbagecollector/garbagecollector_test.go
+3
-3
graph_builder.go
pkg/controller/garbagecollector/graph_builder.go
+9
-9
hostport_syncer_test.go
pkg/kubelet/network/hostport/hostport_syncer_test.go
+3
-3
prober_manager_test.go
pkg/kubelet/prober/prober_manager_test.go
+10
-10
hash_test.go
pkg/util/hash/hash_test.go
+4
-4
flocker_test.go
pkg/volume/flocker/flocker_test.go
+3
-3
admission.go
plugin/pkg/admission/namespace/lifecycle/admission.go
+1
-1
objectmeta.go
.../src/k8s.io/apimachinery/pkg/api/validation/objectmeta.go
+1
-1
storage_factory.go
...rc/k8s.io/apiserver/pkg/server/storage/storage_factory.go
+7
-7
discovery_client_test.go
...g/src/k8s.io/client-go/discovery/discovery_client_test.go
+6
-6
controller_test.go
staging/src/k8s.io/client-go/tools/cache/controller_test.go
+3
-3
No files found.
cmd/libs/go2idl/client-gen/main.go
View file @
6681835b
...
...
@@ -174,7 +174,7 @@ func main() {
arguments
.
CustomArgs
=
clientgenargs
.
Args
{
Groups
:
[]
types
.
GroupVersions
{{
Group
:
"testgroup"
,
Versions
:
[]
types
.
Version
{
""
}}},
GroupVersionToInputPath
:
map
[
types
.
GroupVersion
]
string
{
types
.
GroupVersion
{
Group
:
"testgroup"
,
Version
:
""
}
:
"k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup"
,
{
Group
:
"testgroup"
,
Version
:
""
}
:
"k8s.io/kubernetes/cmd/libs/go2idl/client-gen/test_apis/testgroup"
,
},
ClientsetName
:
"test_internalclientset"
,
ClientsetOutputPath
:
"k8s.io/kubernetes/cmd/libs/go2idl/client-gen/testoutput/clientset_generated/"
,
...
...
pkg/controller/garbagecollector/garbagecollector_test.go
View file @
6681835b
...
...
@@ -51,9 +51,9 @@ func TestNewGarbageCollector(t *testing.T) {
config
.
ContentConfig
.
NegotiatedSerializer
=
nil
clientPool
:=
dynamic
.
NewClientPool
(
config
,
api
.
Registry
.
RESTMapper
(),
dynamic
.
LegacyAPIPathResolverFunc
)
podResource
:=
map
[
schema
.
GroupVersionResource
]
struct
{}{
schema
.
GroupVersionResource
{
Version
:
"v1"
,
Resource
:
"pods"
}
:
{},
{
Version
:
"v1"
,
Resource
:
"pods"
}
:
{},
// no monitor will be constructed for non-core resource, the GC construction will not fail.
schema
.
GroupVersionResource
{
Group
:
"tpr.io"
,
Version
:
"v1"
,
Resource
:
"unknown"
}
:
{},
{
Group
:
"tpr.io"
,
Version
:
"v1"
,
Resource
:
"unknown"
}
:
{},
}
gc
,
err
:=
NewGarbageCollector
(
metaOnlyClientPool
,
clientPool
,
api
.
Registry
.
RESTMapper
(),
podResource
)
if
err
!=
nil
{
...
...
@@ -118,7 +118,7 @@ func setupGC(t *testing.T, config *restclient.Config) *GarbageCollector {
metaOnlyClientPool
:=
dynamic
.
NewClientPool
(
config
,
api
.
Registry
.
RESTMapper
(),
dynamic
.
LegacyAPIPathResolverFunc
)
config
.
ContentConfig
.
NegotiatedSerializer
=
nil
clientPool
:=
dynamic
.
NewClientPool
(
config
,
api
.
Registry
.
RESTMapper
(),
dynamic
.
LegacyAPIPathResolverFunc
)
podResource
:=
map
[
schema
.
GroupVersionResource
]
struct
{}{
schema
.
GroupVersionResource
{
Version
:
"v1"
,
Resource
:
"pods"
}
:
{}}
podResource
:=
map
[
schema
.
GroupVersionResource
]
struct
{}{{
Version
:
"v1"
,
Resource
:
"pods"
}
:
{}}
gc
,
err
:=
NewGarbageCollector
(
metaOnlyClientPool
,
clientPool
,
api
.
Registry
.
RESTMapper
(),
podResource
)
if
err
!=
nil
{
t
.
Fatal
(
err
)
...
...
pkg/controller/garbagecollector/graph_builder.go
View file @
6681835b
...
...
@@ -195,15 +195,15 @@ func (gb *GraphBuilder) Run(stopCh <-chan struct{}) {
}
var
ignoredResources
=
map
[
schema
.
GroupVersionResource
]
struct
{}{
schema
.
GroupVersionResource
{
Group
:
"extensions"
,
Version
:
"v1beta1"
,
Resource
:
"replicationcontrollers"
}
:
{},
schema
.
GroupVersionResource
{
Group
:
""
,
Version
:
"v1"
,
Resource
:
"bindings"
}
:
{},
schema
.
GroupVersionResource
{
Group
:
""
,
Version
:
"v1"
,
Resource
:
"componentstatuses"
}
:
{},
schema
.
GroupVersionResource
{
Group
:
""
,
Version
:
"v1"
,
Resource
:
"events"
}
:
{},
schema
.
GroupVersionResource
{
Group
:
"authentication.k8s.io"
,
Version
:
"v1beta1"
,
Resource
:
"tokenreviews"
}
:
{},
schema
.
GroupVersionResource
{
Group
:
"authorization.k8s.io"
,
Version
:
"v1beta1"
,
Resource
:
"subjectaccessreviews"
}
:
{},
schema
.
GroupVersionResource
{
Group
:
"authorization.k8s.io"
,
Version
:
"v1beta1"
,
Resource
:
"selfsubjectaccessreviews"
}
:
{},
schema
.
GroupVersionResource
{
Group
:
"authorization.k8s.io"
,
Version
:
"v1beta1"
,
Resource
:
"localsubjectaccessreviews"
}
:
{},
schema
.
GroupVersionResource
{
Group
:
"apiregistration.k8s.io"
,
Version
:
"v1alpha1"
,
Resource
:
"apiservices"
}
:
{},
{
Group
:
"extensions"
,
Version
:
"v1beta1"
,
Resource
:
"replicationcontrollers"
}
:
{},
{
Group
:
""
,
Version
:
"v1"
,
Resource
:
"bindings"
}
:
{},
{
Group
:
""
,
Version
:
"v1"
,
Resource
:
"componentstatuses"
}
:
{},
{
Group
:
""
,
Version
:
"v1"
,
Resource
:
"events"
}
:
{},
{
Group
:
"authentication.k8s.io"
,
Version
:
"v1beta1"
,
Resource
:
"tokenreviews"
}
:
{},
{
Group
:
"authorization.k8s.io"
,
Version
:
"v1beta1"
,
Resource
:
"subjectaccessreviews"
}
:
{},
{
Group
:
"authorization.k8s.io"
,
Version
:
"v1beta1"
,
Resource
:
"selfsubjectaccessreviews"
}
:
{},
{
Group
:
"authorization.k8s.io"
,
Version
:
"v1beta1"
,
Resource
:
"localsubjectaccessreviews"
}
:
{},
{
Group
:
"apiregistration.k8s.io"
,
Version
:
"v1alpha1"
,
Resource
:
"apiservices"
}
:
{},
}
func
(
gb
*
GraphBuilder
)
enqueueChanges
(
e
*
event
)
{
...
...
pkg/kubelet/network/hostport/hostport_syncer_test.go
View file @
6681835b
...
...
@@ -206,9 +206,9 @@ func TestOpenPodHostports(t *testing.T) {
// Socket
hostPortMap
:=
map
[
hostport
]
closeable
{
hostport
{
123
,
"tcp"
}
:
&
fakeSocket
{
123
,
"tcp"
,
false
},
hostport
{
4567
,
"tcp"
}
:
&
fakeSocket
{
4567
,
"tcp"
,
false
},
hostport
{
5678
,
"udp"
}
:
&
fakeSocket
{
5678
,
"udp"
,
false
},
{
123
,
"tcp"
}
:
&
fakeSocket
{
123
,
"tcp"
,
false
},
{
4567
,
"tcp"
}
:
&
fakeSocket
{
4567
,
"tcp"
,
false
},
{
5678
,
"udp"
}
:
&
fakeSocket
{
5678
,
"udp"
,
false
},
}
if
!
reflect
.
DeepEqual
(
hostPortMap
,
h
.
hostPortMap
)
{
t
.
Fatalf
(
"Mismatch in expected hostPortMap. Expected '%v', got '%v'"
,
hostPortMap
,
h
.
hostPortMap
)
...
...
pkg/kubelet/prober/prober_manager_test.go
View file @
6681835b
...
...
@@ -249,11 +249,11 @@ func TestUpdatePodStatus(t *testing.T) {
// Setup probe "workers" and cached results.
m
.
workers
=
map
[
probeKey
]
*
worker
{
probeKey
{
testPodUID
,
unprobed
.
Name
,
liveness
}
:
{},
probeKey
{
testPodUID
,
probedReady
.
Name
,
readiness
}
:
{},
probeKey
{
testPodUID
,
probedPending
.
Name
,
readiness
}
:
{},
probeKey
{
testPodUID
,
probedUnready
.
Name
,
readiness
}
:
{},
probeKey
{
testPodUID
,
terminated
.
Name
,
readiness
}
:
{},
{
testPodUID
,
unprobed
.
Name
,
liveness
}
:
{},
{
testPodUID
,
probedReady
.
Name
,
readiness
}
:
{},
{
testPodUID
,
probedPending
.
Name
,
readiness
}
:
{},
{
testPodUID
,
probedUnready
.
Name
,
readiness
}
:
{},
{
testPodUID
,
terminated
.
Name
,
readiness
}
:
{},
}
m
.
readinessManager
.
Set
(
kubecontainer
.
ParseContainerID
(
probedReady
.
ContainerID
),
results
.
Success
,
&
v1
.
Pod
{})
m
.
readinessManager
.
Set
(
kubecontainer
.
ParseContainerID
(
probedUnready
.
ContainerID
),
results
.
Failure
,
&
v1
.
Pod
{})
...
...
@@ -262,11 +262,11 @@ func TestUpdatePodStatus(t *testing.T) {
m
.
UpdatePodStatus
(
testPodUID
,
&
podStatus
)
expectedReadiness
:=
map
[
probeKey
]
bool
{
probeKey
{
testPodUID
,
unprobed
.
Name
,
readiness
}
:
true
,
probeKey
{
testPodUID
,
probedReady
.
Name
,
readiness
}
:
true
,
probeKey
{
testPodUID
,
probedPending
.
Name
,
readiness
}
:
false
,
probeKey
{
testPodUID
,
probedUnready
.
Name
,
readiness
}
:
false
,
probeKey
{
testPodUID
,
terminated
.
Name
,
readiness
}
:
false
,
{
testPodUID
,
unprobed
.
Name
,
readiness
}
:
true
,
{
testPodUID
,
probedReady
.
Name
,
readiness
}
:
true
,
{
testPodUID
,
probedPending
.
Name
,
readiness
}
:
false
,
{
testPodUID
,
probedUnready
.
Name
,
readiness
}
:
false
,
{
testPodUID
,
terminated
.
Name
,
readiness
}
:
false
,
}
for
_
,
c
:=
range
podStatus
.
ContainerStatuses
{
expected
,
ok
:=
expectedReadiness
[
probeKey
{
testPodUID
,
c
.
Name
,
readiness
}]
...
...
pkg/util/hash/hash_test.go
View file @
6681835b
...
...
@@ -56,10 +56,10 @@ func TestDeepHashObject(t *testing.T) {
func
()
interface
{}
{
return
B
{[]
int
{
8
,
6
,
7
},
map
[
string
]
bool
{
"5"
:
true
,
"3"
:
true
,
"0"
:
true
,
"9"
:
true
}}
},
func
()
interface
{}
{
return
map
[
A
]
bool
{
A
{
8675309
,
"Jenny"
}
:
true
,
A
{
9765683
,
"!Jenny"
}
:
false
}
},
func
()
interface
{}
{
return
map
[
C
]
bool
{
C
{
8675309
,
"Jenny"
}
:
true
,
C
{
9765683
,
"!Jenny"
}
:
false
}
},
func
()
interface
{}
{
return
map
[
*
A
]
bool
{
&
A
{
8675309
,
"Jenny"
}
:
true
,
&
A
{
9765683
,
"!Jenny"
}
:
false
}
},
func
()
interface
{}
{
return
map
[
*
C
]
bool
{
&
C
{
8675309
,
"Jenny"
}
:
true
,
&
C
{
9765683
,
"!Jenny"
}
:
false
}
},
func
()
interface
{}
{
return
map
[
A
]
bool
{
{
8675309
,
"Jenny"
}
:
true
,
{
9765683
,
"!Jenny"
}
:
false
}
},
func
()
interface
{}
{
return
map
[
C
]
bool
{
{
8675309
,
"Jenny"
}
:
true
,
{
9765683
,
"!Jenny"
}
:
false
}
},
func
()
interface
{}
{
return
map
[
*
A
]
bool
{
{
8675309
,
"Jenny"
}
:
true
,
{
9765683
,
"!Jenny"
}
:
false
}
},
func
()
interface
{}
{
return
map
[
*
C
]
bool
{
{
8675309
,
"Jenny"
}
:
true
,
{
9765683
,
"!Jenny"
}
:
false
}
},
}
for
_
,
tc
:=
range
successCases
{
...
...
pkg/volume/flocker/flocker_test.go
View file @
6681835b
...
...
@@ -182,14 +182,14 @@ func TestCanSupport(t *testing.T) {
assert
.
NoError
(
err
)
specs
:=
map
[
*
volume
.
Spec
]
bool
{
&
volume
.
Spec
{
{
Volume
:
&
v1
.
Volume
{
VolumeSource
:
v1
.
VolumeSource
{
Flocker
:
&
v1
.
FlockerVolumeSource
{},
},
},
}
:
true
,
&
volume
.
Spec
{
{
PersistentVolume
:
&
v1
.
PersistentVolume
{
Spec
:
v1
.
PersistentVolumeSpec
{
PersistentVolumeSource
:
v1
.
PersistentVolumeSource
{
...
...
@@ -198,7 +198,7 @@ func TestCanSupport(t *testing.T) {
},
},
}
:
true
,
&
volume
.
Spec
{
{
Volume
:
&
v1
.
Volume
{
VolumeSource
:
v1
.
VolumeSource
{},
},
...
...
plugin/pkg/admission/namespace/lifecycle/admission.go
View file @
6681835b
...
...
@@ -216,7 +216,7 @@ func (l *lifecycle) Validate() error {
// accessReviewResources are resources which give a view into permissions in a namespace. Users must be allowed to create these
// resources because returning "not found" errors allows someone to search for the "people I'm going to fire in 2017" namespace.
var
accessReviewResources
=
map
[
schema
.
GroupResource
]
bool
{
schema
.
GroupResource
{
Group
:
"authorization.k8s.io"
,
Resource
:
"localsubjectaccessreviews"
}
:
true
,
{
Group
:
"authorization.k8s.io"
,
Resource
:
"localsubjectaccessreviews"
}
:
true
,
}
func
isAccessReview
(
a
admission
.
Attributes
)
bool
{
...
...
staging/src/k8s.io/apimachinery/pkg/api/validation/objectmeta.go
View file @
6681835b
...
...
@@ -39,7 +39,7 @@ const totalAnnotationSizeLimitB int = 256 * (1 << 10) // 256 kB
// BannedOwners is a black list of object that are not allowed to be owners.
var
BannedOwners
=
map
[
schema
.
GroupVersionKind
]
struct
{}{
schema
.
GroupVersionKind
{
Group
:
""
,
Version
:
"v1"
,
Kind
:
"Event"
}
:
{},
{
Group
:
""
,
Version
:
"v1"
,
Kind
:
"Event"
}
:
{},
}
// ValidateClusterName can be used to check whether the given cluster name is valid.
...
...
staging/src/k8s.io/apiserver/pkg/server/storage/storage_factory.go
View file @
6681835b
...
...
@@ -129,13 +129,13 @@ const AllResources = "*"
// specialDefaultResourcePrefixes are prefixes compiled into Kubernetes.
// TODO: move out of this package, it is not generic
var
specialDefaultResourcePrefixes
=
map
[
schema
.
GroupResource
]
string
{
schema
.
GroupResource
{
Group
:
""
,
Resource
:
"replicationControllers"
}
:
"controllers"
,
schema
.
GroupResource
{
Group
:
""
,
Resource
:
"replicationcontrollers"
}
:
"controllers"
,
schema
.
GroupResource
{
Group
:
""
,
Resource
:
"endpoints"
}
:
"services/endpoints"
,
schema
.
GroupResource
{
Group
:
""
,
Resource
:
"nodes"
}
:
"minions"
,
schema
.
GroupResource
{
Group
:
""
,
Resource
:
"services"
}
:
"services/specs"
,
schema
.
GroupResource
{
Group
:
"extensions"
,
Resource
:
"ingresses"
}
:
"ingress"
,
schema
.
GroupResource
{
Group
:
"extensions"
,
Resource
:
"podsecuritypolicies"
}
:
"podsecuritypolicy"
,
{
Group
:
""
,
Resource
:
"replicationControllers"
}
:
"controllers"
,
{
Group
:
""
,
Resource
:
"replicationcontrollers"
}
:
"controllers"
,
{
Group
:
""
,
Resource
:
"endpoints"
}
:
"services/endpoints"
,
{
Group
:
""
,
Resource
:
"nodes"
}
:
"minions"
,
{
Group
:
""
,
Resource
:
"services"
}
:
"services/specs"
,
{
Group
:
"extensions"
,
Resource
:
"ingresses"
}
:
"ingress"
,
{
Group
:
"extensions"
,
Resource
:
"podsecuritypolicies"
}
:
"podsecuritypolicy"
,
}
func
NewDefaultStorageFactory
(
config
storagebackend
.
Config
,
defaultMediaType
string
,
defaultSerializer
runtime
.
StorageSerializer
,
resourceEncodingConfig
ResourceEncodingConfig
,
resourceConfig
APIResourceConfigSource
)
*
DefaultStorageFactory
{
...
...
staging/src/k8s.io/client-go/discovery/discovery_client_test.go
View file @
6681835b
...
...
@@ -617,8 +617,8 @@ func TestServerPreferredNamespacedResources(t *testing.T) {
w
.
Write
(
output
)
},
expected
:
map
[
schema
.
GroupVersionResource
]
struct
{}{
schema
.
GroupVersionResource
{
Group
:
""
,
Version
:
"v1"
,
Resource
:
"pods"
}
:
{},
schema
.
GroupVersionResource
{
Group
:
""
,
Version
:
"v1"
,
Resource
:
"services"
}
:
{},
{
Group
:
""
,
Version
:
"v1"
,
Resource
:
"pods"
}
:
{},
{
Group
:
""
,
Version
:
"v1"
,
Resource
:
"services"
}
:
{},
},
},
{
...
...
@@ -660,8 +660,8 @@ func TestServerPreferredNamespacedResources(t *testing.T) {
w
.
Write
(
output
)
},
expected
:
map
[
schema
.
GroupVersionResource
]
struct
{}{
schema
.
GroupVersionResource
{
Group
:
"batch"
,
Version
:
"v1"
,
Resource
:
"jobs"
}
:
{},
schema
.
GroupVersionResource
{
Group
:
"batch"
,
Version
:
"v2alpha1"
,
Resource
:
"cronjobs"
}
:
{},
{
Group
:
"batch"
,
Version
:
"v1"
,
Resource
:
"jobs"
}
:
{},
{
Group
:
"batch"
,
Version
:
"v2alpha1"
,
Resource
:
"cronjobs"
}
:
{},
},
},
{
...
...
@@ -703,8 +703,8 @@ func TestServerPreferredNamespacedResources(t *testing.T) {
w
.
Write
(
output
)
},
expected
:
map
[
schema
.
GroupVersionResource
]
struct
{}{
schema
.
GroupVersionResource
{
Group
:
"batch"
,
Version
:
"v2alpha1"
,
Resource
:
"jobs"
}
:
{},
schema
.
GroupVersionResource
{
Group
:
"batch"
,
Version
:
"v2alpha1"
,
Resource
:
"cronjobs"
}
:
{},
{
Group
:
"batch"
,
Version
:
"v2alpha1"
,
Resource
:
"jobs"
}
:
{},
{
Group
:
"batch"
,
Version
:
"v2alpha1"
,
Resource
:
"cronjobs"
}
:
{},
},
},
}
...
...
staging/src/k8s.io/client-go/tools/cache/controller_test.go
View file @
6681835b
...
...
@@ -307,13 +307,13 @@ func TestUpdate(t *testing.T) {
// asynchronous, there are a lot of valid possibilities.
type
pair
struct
{
from
,
to
string
}
allowedTransitions
:=
map
[
pair
]
bool
{
pair
{
FROM
,
TO
}
:
true
,
{
FROM
,
TO
}
:
true
,
// Because a resync can happen when we've already observed one
// of the above but before the item is deleted.
pair
{
TO
,
TO
}
:
true
,
{
TO
,
TO
}
:
true
,
// Because a resync could happen before we observe an update.
pair
{
FROM
,
FROM
}
:
true
,
{
FROM
,
FROM
}
:
true
,
}
pod
:=
func
(
name
,
check
string
,
final
bool
)
*
v1
.
Pod
{
...
...
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