mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 12:43:23 +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.
|
||||
for _, kind := range []string{
|
||||
for _, k := range []string{
|
||||
"Endpoints",
|
||||
"ResourceQuota",
|
||||
"PersistentVolumeClaim",
|
||||
@ -172,6 +172,7 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
|
||||
"ServiceAccount",
|
||||
"ConfigMap",
|
||||
} {
|
||||
kind := k // don't close over range variables
|
||||
err = scheme.AddFieldLabelConversionFunc("v1", kind,
|
||||
func(label, value string) (string, string, error) {
|
||||
switch label {
|
||||
|
@ -57,7 +57,8 @@ func addConversionFuncs(scheme *runtime.Scheme) error {
|
||||
}
|
||||
|
||||
// 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,
|
||||
func(label, value string) (string, string, error) {
|
||||
switch label {
|
||||
|
Loading…
Reference in New Issue
Block a user