mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 05:03:09 +00:00
Merge pull request #31053 from justinsb/dont_close_over_range_loops
Automatic merge from submit-queue Avoid closing over range variables
This commit is contained in:
commit
b569a8daa9
@ -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 _, kind := range []string{
|
for _, k := range []string{
|
||||||
"Endpoints",
|
"Endpoints",
|
||||||
"ResourceQuota",
|
"ResourceQuota",
|
||||||
"PersistentVolumeClaim",
|
"PersistentVolumeClaim",
|
||||||
@ -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 {
|
||||||
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user