Remove unnecessary type conversion
This commit is contained in:
parent
30d78b0dd6
commit
a6fa888e73
|
|
@ -61,7 +61,7 @@ func BenchmarkMetricWrite(b *testing.B) {
|
|||
metric: Metric{
|
||||
LabelKeys: []string{"container", "container_id", "image", "image_id", "namespace", "pod"},
|
||||
LabelValues: []string{"container2", "docker://cd456", "k8s.gcr.io/hyperkube2", "docker://sha256:bbb", "ns2", "pod2"},
|
||||
Value: float64(35.7),
|
||||
Value: 35.7,
|
||||
},
|
||||
expectedLength: 148,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ func (m *MetricsHandler) Run(ctx context.Context) error {
|
|||
statefulSetName := ss.Name
|
||||
|
||||
labelSelectorOptions := func(o *metav1.ListOptions) {
|
||||
o.LabelSelector = fields.SelectorFromSet(fields.Set(ss.Labels)).String()
|
||||
o.LabelSelector = fields.SelectorFromSet(ss.Labels).String()
|
||||
}
|
||||
|
||||
i := cache.NewSharedIndexInformer(
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ func (s *shardedListWatch) Watch(options metav1.ListOptions) (watch.Interface, e
|
|||
return nil, err
|
||||
}
|
||||
|
||||
return watch.Filter(w, watch.FilterFunc(func(in watch.Event) (out watch.Event, keep bool) {
|
||||
return watch.Filter(w, func(in watch.Event) (out watch.Event, keep bool) {
|
||||
a, err := meta.Accessor(in.Object)
|
||||
if err != nil {
|
||||
// TODO(brancz): needs logging
|
||||
|
|
@ -81,7 +81,7 @@ func (s *shardedListWatch) Watch(options metav1.ListOptions) (watch.Interface, e
|
|||
}
|
||||
|
||||
return in, s.sharding.keep(a)
|
||||
})), nil
|
||||
}), nil
|
||||
}
|
||||
|
||||
type sharding struct {
|
||||
|
|
|
|||
Loading…
Reference in New Issue