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
eb516fbc
Commit
eb516fbc
authored
Aug 15, 2016
by
Hongchao Deng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize field.Set{} -> nil
parent
75fe25e7
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
15 additions
and
11 deletions
+15
-11
strategy.go
pkg/registry/certificates/strategy.go
+1
-1
strategy.go
pkg/registry/clusterrole/strategy.go
+1
-1
strategy.go
pkg/registry/clusterrolebinding/strategy.go
+1
-1
matcher.go
pkg/registry/generic/matcher.go
+5
-1
strategy.go
pkg/registry/horizontalpodautoscaler/strategy.go
+1
-1
strategy.go
pkg/registry/limitrange/strategy.go
+1
-1
strategy.go
pkg/registry/podtemplate/strategy.go
+1
-1
strategy.go
pkg/registry/role/strategy.go
+1
-1
strategy.go
pkg/registry/rolebinding/strategy.go
+1
-1
strategy.go
pkg/registry/thirdpartyresource/strategy.go
+1
-1
strategy.go
pkg/registry/thirdpartyresourcedata/strategy.go
+1
-1
No files found.
pkg/registry/certificates/strategy.go
View file @
eb516fbc
...
@@ -184,5 +184,5 @@ func Matcher(label labels.Selector, field fields.Selector) *generic.SelectionPre
...
@@ -184,5 +184,5 @@ func Matcher(label labels.Selector, field fields.Selector) *generic.SelectionPre
// SelectableFields returns a field set that can be used for filter selection
// SelectableFields returns a field set that can be used for filter selection
func
SelectableFields
(
obj
*
certificates
.
CertificateSigningRequest
)
fields
.
Set
{
func
SelectableFields
(
obj
*
certificates
.
CertificateSigningRequest
)
fields
.
Set
{
return
fields
.
Set
{}
return
nil
}
}
pkg/registry/clusterrole/strategy.go
View file @
eb516fbc
...
@@ -118,5 +118,5 @@ func Matcher(label labels.Selector, field fields.Selector) *generic.SelectionPre
...
@@ -118,5 +118,5 @@ func Matcher(label labels.Selector, field fields.Selector) *generic.SelectionPre
// SelectableFields returns a field set that can be used for filter selection
// SelectableFields returns a field set that can be used for filter selection
func
SelectableFields
(
obj
*
rbac
.
ClusterRole
)
fields
.
Set
{
func
SelectableFields
(
obj
*
rbac
.
ClusterRole
)
fields
.
Set
{
return
fields
.
Set
{}
return
nil
}
}
pkg/registry/clusterrolebinding/strategy.go
View file @
eb516fbc
...
@@ -118,5 +118,5 @@ func Matcher(label labels.Selector, field fields.Selector) *generic.SelectionPre
...
@@ -118,5 +118,5 @@ func Matcher(label labels.Selector, field fields.Selector) *generic.SelectionPre
// SelectableFields returns a field set that can be used for filter selection
// SelectableFields returns a field set that can be used for filter selection
func
SelectableFields
(
obj
*
rbac
.
ClusterRoleBinding
)
fields
.
Set
{
func
SelectableFields
(
obj
*
rbac
.
ClusterRoleBinding
)
fields
.
Set
{
return
fields
.
Set
{}
return
nil
}
}
pkg/registry/generic/matcher.go
View file @
eb516fbc
...
@@ -68,7 +68,11 @@ func (s *SelectionPredicate) Matches(obj runtime.Object) (bool, error) {
...
@@ -68,7 +68,11 @@ func (s *SelectionPredicate) Matches(obj runtime.Object) (bool, error) {
if
err
!=
nil
{
if
err
!=
nil
{
return
false
,
err
return
false
,
err
}
}
return
s
.
Label
.
Matches
(
labels
)
&&
s
.
Field
.
Matches
(
fields
),
nil
matched
:=
s
.
Label
.
Matches
(
labels
)
if
s
.
Field
!=
nil
{
matched
=
(
matched
&&
s
.
Field
.
Matches
(
fields
))
}
return
matched
,
nil
}
}
// MatchesSingle will return (name, true) if and only if s.Field matches on the object's
// MatchesSingle will return (name, true) if and only if s.Field matches on the object's
...
...
pkg/registry/horizontalpodautoscaler/strategy.go
View file @
eb516fbc
...
@@ -85,7 +85,7 @@ func (autoscalerStrategy) AllowUnconditionalUpdate() bool {
...
@@ -85,7 +85,7 @@ func (autoscalerStrategy) AllowUnconditionalUpdate() bool {
}
}
func
AutoscalerToSelectableFields
(
hpa
*
autoscaling
.
HorizontalPodAutoscaler
)
fields
.
Set
{
func
AutoscalerToSelectableFields
(
hpa
*
autoscaling
.
HorizontalPodAutoscaler
)
fields
.
Set
{
return
fields
.
Set
{}
return
nil
}
}
func
MatchAutoscaler
(
label
labels
.
Selector
,
field
fields
.
Selector
)
*
generic
.
SelectionPredicate
{
func
MatchAutoscaler
(
label
labels
.
Selector
,
field
fields
.
Selector
)
*
generic
.
SelectionPredicate
{
...
...
pkg/registry/limitrange/strategy.go
View file @
eb516fbc
...
@@ -75,7 +75,7 @@ func (limitrangeStrategy) AllowUnconditionalUpdate() bool {
...
@@ -75,7 +75,7 @@ func (limitrangeStrategy) AllowUnconditionalUpdate() bool {
}
}
func
LimitRangeToSelectableFields
(
limitRange
*
api
.
LimitRange
)
fields
.
Set
{
func
LimitRangeToSelectableFields
(
limitRange
*
api
.
LimitRange
)
fields
.
Set
{
return
fields
.
Set
{}
return
nil
}
}
func
(
limitrangeStrategy
)
Export
(
api
.
Context
,
runtime
.
Object
,
bool
)
error
{
func
(
limitrangeStrategy
)
Export
(
api
.
Context
,
runtime
.
Object
,
bool
)
error
{
...
...
pkg/registry/podtemplate/strategy.go
View file @
eb516fbc
...
@@ -83,7 +83,7 @@ func (podTemplateStrategy) Export(ctx api.Context, obj runtime.Object, exact boo
...
@@ -83,7 +83,7 @@ func (podTemplateStrategy) Export(ctx api.Context, obj runtime.Object, exact boo
}
}
func
PodTemplateToSelectableFields
(
podTemplate
*
api
.
PodTemplate
)
fields
.
Set
{
func
PodTemplateToSelectableFields
(
podTemplate
*
api
.
PodTemplate
)
fields
.
Set
{
return
fields
.
Set
{}
return
nil
}
}
func
MatchPodTemplate
(
label
labels
.
Selector
,
field
fields
.
Selector
)
*
generic
.
SelectionPredicate
{
func
MatchPodTemplate
(
label
labels
.
Selector
,
field
fields
.
Selector
)
*
generic
.
SelectionPredicate
{
...
...
pkg/registry/role/strategy.go
View file @
eb516fbc
...
@@ -118,5 +118,5 @@ func Matcher(label labels.Selector, field fields.Selector) *generic.SelectionPre
...
@@ -118,5 +118,5 @@ func Matcher(label labels.Selector, field fields.Selector) *generic.SelectionPre
// SelectableFields returns a field set that can be used for filter selection
// SelectableFields returns a field set that can be used for filter selection
func
SelectableFields
(
obj
*
rbac
.
Role
)
fields
.
Set
{
func
SelectableFields
(
obj
*
rbac
.
Role
)
fields
.
Set
{
return
fields
.
Set
{}
return
nil
}
}
pkg/registry/rolebinding/strategy.go
View file @
eb516fbc
...
@@ -118,5 +118,5 @@ func Matcher(label labels.Selector, field fields.Selector) *generic.SelectionPre
...
@@ -118,5 +118,5 @@ func Matcher(label labels.Selector, field fields.Selector) *generic.SelectionPre
// SelectableFields returns a field set that can be used for filter selection
// SelectableFields returns a field set that can be used for filter selection
func
SelectableFields
(
obj
*
rbac
.
RoleBinding
)
fields
.
Set
{
func
SelectableFields
(
obj
*
rbac
.
RoleBinding
)
fields
.
Set
{
return
fields
.
Set
{}
return
nil
}
}
pkg/registry/thirdpartyresource/strategy.go
View file @
eb516fbc
...
@@ -94,5 +94,5 @@ func Matcher(label labels.Selector, field fields.Selector) *generic.SelectionPre
...
@@ -94,5 +94,5 @@ func Matcher(label labels.Selector, field fields.Selector) *generic.SelectionPre
// SelectableFields returns a field set that can be used for filter selection
// SelectableFields returns a field set that can be used for filter selection
func
SelectableFields
(
obj
*
extensions
.
ThirdPartyResource
)
fields
.
Set
{
func
SelectableFields
(
obj
*
extensions
.
ThirdPartyResource
)
fields
.
Set
{
return
fields
.
Set
{}
return
nil
}
}
pkg/registry/thirdpartyresourcedata/strategy.go
View file @
eb516fbc
...
@@ -91,5 +91,5 @@ func Matcher(label labels.Selector, field fields.Selector) *generic.SelectionPre
...
@@ -91,5 +91,5 @@ func Matcher(label labels.Selector, field fields.Selector) *generic.SelectionPre
// SelectableFields returns a field set that can be used for filter selection
// SelectableFields returns a field set that can be used for filter selection
func
SelectableFields
(
obj
*
extensions
.
ThirdPartyResourceData
)
fields
.
Set
{
func
SelectableFields
(
obj
*
extensions
.
ThirdPartyResourceData
)
fields
.
Set
{
return
fields
.
Set
{}
return
nil
}
}
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