From 7949c70929970c4c94beae01042483d19d6ced4e Mon Sep 17 00:00:00 2001 From: derailed Date: Fri, 10 Jan 2020 13:16:23 -0700 Subject: [PATCH] rev docker go + cleanup --- Dockerfile | 2 +- internal/client/types.go | 4 ++-- internal/model/log.go | 2 ++ internal/ui/table_helper.go | 2 +- internal/view/log.go | 2 +- internal/watch/helper.go | 4 ++-- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7eb5e91b..75fa1da8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build... -FROM golang:1.12.6-alpine AS build +FROM golang:1.13.6-alpine3.11 AS build WORKDIR /k9s COPY go.mod go.sum main.go Makefile ./ diff --git a/internal/client/types.go b/internal/client/types.go index 1a37ab5e..a23348ec 100644 --- a/internal/client/types.go +++ b/internal/client/types.go @@ -29,7 +29,7 @@ const ( CreateVerb = "create" // UpdateVerb represents an update access on a resource. UpdateVerb = "update" - // UpdateVerb represents a patch access on a resource. + // PatchVerb represents a patch access on a resource. PatchVerb = "patch" // DeleteVerb represents a delete access on a resource. DeleteVerb = "delete" @@ -46,7 +46,7 @@ var ( GetAccess = []string{GetVerb} // ListAccess list resources. ListAccess = []string{ListVerb} - // MonitorAcces monitors a collection of resources. + // MonitorAccess monitors a collection of resources. MonitorAccess = []string{ListVerb, WatchVerb} // ReadAllAccess represents an all read access to a resource. ReadAllAccess = []string{GetVerb, ListVerb, WatchVerb} diff --git a/internal/model/log.go b/internal/model/log.go index bd66b4bb..a52d5abe 100644 --- a/internal/model/log.go +++ b/internal/model/log.go @@ -145,6 +145,7 @@ func (l *Log) load() error { return nil } +// Append adds a log line. func (l *Log) Append(line string) { if line == "" { return @@ -171,6 +172,7 @@ func (l *Log) Append(line string) { log.Debug().Msgf("MODEL %d--%d", len(l.lines), l.lastSent) } +// Notify fires of notifications to the listeners. func (l *Log) Notify(timedOut bool) { l.mx.Lock() defer l.mx.Unlock() diff --git a/internal/ui/table_helper.go b/internal/ui/table_helper.go index 663a95f0..2bebdeab 100644 --- a/internal/ui/table_helper.go +++ b/internal/ui/table_helper.go @@ -62,7 +62,7 @@ func IsLabelSelector(s string) bool { return LableRx.MatchString(s) } -// IsFuzztySelector checks if query is fuzzy. +// IsFuzzySelector checks if query is fuzzy. func IsFuzzySelector(s string) bool { if s == "" { return false diff --git a/internal/view/log.go b/internal/view/log.go index ba6ec2f5..530c08bc 100644 --- a/internal/view/log.go +++ b/internal/view/log.go @@ -26,7 +26,7 @@ const ( logFmt = " Logs([fg:bg:]%s) " // BOZO!! Canned! Need config tail line counts! - tailLineCount = 1_000 + tailLineCount = 1000 defaultTimeout = 200 * time.Millisecond ) diff --git a/internal/watch/helper.go b/internal/watch/helper.go index 5e018b30..d75169a0 100644 --- a/internal/watch/helper.go +++ b/internal/watch/helper.go @@ -27,7 +27,7 @@ func namespaced(n string) (string, string) { return strings.Trim(ns, "/"), po } -// Dump for debug. +// DumpFactory for debug. func DumpFactory(f *Factory) { log.Debug().Msgf("----------- FACTORIES -------------") for ns := range f.factories { @@ -36,7 +36,7 @@ func DumpFactory(f *Factory) { log.Debug().Msgf("-----------------------------------") } -// Debug for debug. +// DebugFactory for debug. func DebugFactory(f *Factory, ns string, gvr string) { log.Debug().Msgf("----------- DEBUG FACTORY (%s) -------------", gvr) fac, ok := f.factories[ns]