checkpoint

mine
derailed 2020-01-04 14:12:37 -07:00
parent 4f05dc9cbf
commit 16473cb1c5
3 changed files with 5 additions and 6 deletions

View File

@ -21,7 +21,7 @@ type Generic struct {
NonResource
}
// Describe describes a k8s resource.
// Describe describes a resource.
func (g *Generic) Describe(path string) (string, error) {
return Describe(g.Client(), g.gvr, path)
}
@ -40,7 +40,7 @@ func (g *Generic) ToYAML(path string) (string, error) {
return raw, nil
}
// List returns a collection of nodes.
// List returns a collection of resources.
func (g *Generic) List(ctx context.Context, ns string) ([]runtime.Object, error) {
labelSel, ok := ctx.Value(internal.KeyLabels).(string)
if !ok {
@ -72,7 +72,7 @@ func (g *Generic) List(ctx context.Context, ns string) ([]runtime.Object, error)
return oo, nil
}
// List returns a collection of node resources.
// Get returns a given resource.
func (g *Generic) Get(ctx context.Context, path string) (runtime.Object, error) {
var opts metav1.GetOptions

View File

@ -39,7 +39,7 @@ func (r *Resource) Get(ctx context.Context, path string) (runtime.Object, error)
return r.Factory.Get(r.gvr.String(), path, true, labels.Everything())
}
// List returns a collection of nodes.
// List returns a collection of resources.
func (r *Resource) List(ctx context.Context, ns string) ([]runtime.Object, error) {
strLabel, ok := ctx.Value(internal.KeyLabels).(string)
lsel := labels.Everything()

View File

@ -101,6 +101,7 @@ func (f *Flash) Errf(fmat string, args ...interface{}) {
f.SetMessage(FlashErr, fmt.Sprintf(fmat, args...))
}
// SetMessage sets flash message and level.
func (f *Flash) SetMessage(level FlashLevel, msg ...string) {
if f.cancel != nil {
f.cancel()
@ -125,10 +126,8 @@ func (f *Flash) refresh(ctx1, ctx2 context.Context, cancel context.CancelFunc) {
defer cancel()
for {
select {
// Timer canceled bail now
case <-ctx1.Done():
return
// Timed out clear and bail
case <-ctx2.Done():
f.app.QueueUpdateDraw(func() {
f.Clear()