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
b569a8da
Commit
b569a8da
authored
Aug 22, 2016
by
Kubernetes Submit Queue
Committed by
GitHub
Aug 22, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #31053 from justinsb/dont_close_over_range_loops
Automatic merge from submit-queue Avoid closing over range variables
parents
48997a4c
3aa4f50a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
conversion.go
pkg/api/v1/conversion.go
+2
-1
conversion.go
pkg/apis/extensions/v1beta1/conversion.go
+2
-1
No files found.
pkg/api/v1/conversion.go
View file @
b569a8da
...
@@ -164,7 +164,7 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
...
@@ -164,7 +164,7 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
}
}
// Add field label conversions for kinds having selectable nothing but ObjectMeta fields.
// Add field label conversions for kinds having selectable nothing but ObjectMeta fields.
for
_
,
k
ind
:=
range
[]
string
{
for
_
,
k
:=
range
[]
string
{
"Endpoints"
,
"Endpoints"
,
"ResourceQuota"
,
"ResourceQuota"
,
"PersistentVolumeClaim"
,
"PersistentVolumeClaim"
,
...
@@ -172,6 +172,7 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
...
@@ -172,6 +172,7 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
"ServiceAccount"
,
"ServiceAccount"
,
"ConfigMap"
,
"ConfigMap"
,
}
{
}
{
kind
:=
k
// don't close over range variables
err
=
scheme
.
AddFieldLabelConversionFunc
(
"v1"
,
kind
,
err
=
scheme
.
AddFieldLabelConversionFunc
(
"v1"
,
kind
,
func
(
label
,
value
string
)
(
string
,
string
,
error
)
{
func
(
label
,
value
string
)
(
string
,
string
,
error
)
{
switch
label
{
switch
label
{
...
...
pkg/apis/extensions/v1beta1/conversion.go
View file @
b569a8da
...
@@ -57,7 +57,8 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
...
@@ -57,7 +57,8 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
}
}
// Add field label conversions for kinds having selectable nothing but ObjectMeta fields.
// Add field label conversions for kinds having selectable nothing but ObjectMeta fields.
for
_
,
kind
:=
range
[]
string
{
"DaemonSet"
,
"Deployment"
,
"Ingress"
}
{
for
_
,
k
:=
range
[]
string
{
"DaemonSet"
,
"Deployment"
,
"Ingress"
}
{
kind
:=
k
// don't close over range variables
err
=
api
.
Scheme
.
AddFieldLabelConversionFunc
(
"extensions/v1beta1"
,
kind
,
err
=
api
.
Scheme
.
AddFieldLabelConversionFunc
(
"extensions/v1beta1"
,
kind
,
func
(
label
,
value
string
)
(
string
,
string
,
error
)
{
func
(
label
,
value
string
)
(
string
,
string
,
error
)
{
switch
label
{
switch
label
{
...
...
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