cleaning up
parent
2268fc7ab4
commit
eed7281caf
|
|
@ -5,7 +5,6 @@ import (
|
||||||
|
|
||||||
"github.com/derailed/k9s/internal"
|
"github.com/derailed/k9s/internal"
|
||||||
"github.com/derailed/k9s/internal/render"
|
"github.com/derailed/k9s/internal/render"
|
||||||
"github.com/rs/zerolog/log"
|
|
||||||
"k8s.io/apimachinery/pkg/labels"
|
"k8s.io/apimachinery/pkg/labels"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
)
|
)
|
||||||
|
|
@ -23,7 +22,6 @@ func (r *Resource) Init(ns, gvr string, f Factory) {
|
||||||
|
|
||||||
// List returns a collection of nodes.
|
// List returns a collection of nodes.
|
||||||
func (r *Resource) List(ctx context.Context) ([]runtime.Object, error) {
|
func (r *Resource) List(ctx context.Context) ([]runtime.Object, error) {
|
||||||
log.Debug().Msgf("MODELLIST %q:%q", r.namespace, r.gvr)
|
|
||||||
strLabel, ok := ctx.Value(internal.KeyLabels).(string)
|
strLabel, ok := ctx.Value(internal.KeyLabels).(string)
|
||||||
lsel := labels.Everything()
|
lsel := labels.Everything()
|
||||||
if sel, err := labels.ConvertSelectorToLabelsMap(strLabel); ok && err == nil {
|
if sel, err := labels.ConvertSelectorToLabelsMap(strLabel); ok && err == nil {
|
||||||
|
|
|
||||||
|
|
@ -65,10 +65,10 @@ func (f *Factory) List(gvr, ns string, sel labels.Selector) ([]runtime.Object, e
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
log.Debug().Msgf("LISTING %q:%q", ns, gvr)
|
|
||||||
if ns == clusterScope {
|
if ns == clusterScope {
|
||||||
return inf.Lister().List(sel)
|
return inf.Lister().List(sel)
|
||||||
}
|
}
|
||||||
|
|
||||||
return inf.Lister().ByNamespace(ns).List(sel)
|
return inf.Lister().ByNamespace(ns).List(sel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -79,8 +79,6 @@ func (f *Factory) Get(gvr, path string, sel labels.Selector) (runtime.Object, er
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
log.Debug().Msgf("GETTING %q:%q", ns, gvr)
|
|
||||||
|
|
||||||
if ns == clusterScope {
|
if ns == clusterScope {
|
||||||
return inf.Lister().Get(n)
|
return inf.Lister().Get(n)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue