diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index ae944162..4e63bf52 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -8,7 +8,7 @@ assignees: '' --- - +

diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 673be323..95731243 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -7,7 +7,7 @@ assignees: '' --- - +

diff --git a/README.md b/README.md index b78ee719..a45b3b4f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - + # Popeye - A Kubernetes Cluster Sanitizer diff --git a/assets/popeye.png b/assets/popeye.png deleted file mode 100644 index 8d07a32b..00000000 Binary files a/assets/popeye.png and /dev/null differ diff --git a/assets/popeye_bug.png b/assets/popeye_bug.png new file mode 100644 index 00000000..51aa95c2 Binary files /dev/null and b/assets/popeye_bug.png differ diff --git a/assets/popeye_feature.png b/assets/popeye_feature.png new file mode 100644 index 00000000..23439383 Binary files /dev/null and b/assets/popeye_feature.png differ diff --git a/assets/popeye_logo.png b/assets/popeye_logo.png new file mode 100644 index 00000000..37d68df7 Binary files /dev/null and b/assets/popeye_logo.png differ diff --git a/internal/issues/issues.go b/internal/issues/issues.go index b12a507e..6a78bed0 100644 --- a/internal/issues/issues.go +++ b/internal/issues/issues.go @@ -29,6 +29,7 @@ func (i Issues) MaxSeverity() config.Level { return max } +// Sort sorts issues. func (i Issues) Sort(l config.Level) Issues { ii := make(Issues, 0, len(i)) gg := i.Group() diff --git a/internal/report/assets/template.html b/internal/report/assets/template.html index 9df1b2b2..b64d62d7 100644 --- a/internal/report/assets/template.html +++ b/internal/report/assets/template.html @@ -180,7 +180,7 @@
Popeye K8s Sanitizer Report
Scanned diff --git a/internal/report/builder.go b/internal/report/builder.go index 4616e6a7..b2d50d83 100644 --- a/internal/report/builder.go +++ b/internal/report/builder.go @@ -288,6 +288,7 @@ func (b *Builder) PrintReport(level config.Level, s *Sanitizer) { // ---------------------------------------------------------------------------- // Helpers... +// Titelize renders a section title. func Titleize(a *internal.Aliases, res string, count int) string { res = a.FromAlias(res) if count <= 0 || res == "general" { diff --git a/internal/report/assets/empty.yml b/internal/report/test_assets/empty.yml similarity index 100% rename from internal/report/assets/empty.yml rename to internal/report/test_assets/empty.yml diff --git a/internal/report/assets/r1.yml b/internal/report/test_assets/r1.yml similarity index 100% rename from internal/report/assets/r1.yml rename to internal/report/test_assets/r1.yml diff --git a/internal/report/assets/r2.yml b/internal/report/test_assets/r2.yml similarity index 100% rename from internal/report/assets/r2.yml rename to internal/report/test_assets/r2.yml diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index a713cac2..a3d0515b 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -25,7 +25,7 @@ func TestNewConfig(t *testing.T) { func TestNewConfigWithFile(t *testing.T) { var ( - dir = "assets/sp1.yml" + dir = "testdata/sp1.yml" ss = []string{"s1", "s2"} f = NewFlags() ) @@ -53,7 +53,7 @@ func TestNewConfigWithFile(t *testing.T) { func TestNewConfigNoResourceSpec(t *testing.T) { var ( - dir = "assets/sp2.yml" + dir = "testdata/sp2.yml" f = NewFlags() ) f.Spinach = &dir @@ -69,7 +69,7 @@ func TestNewConfigNoResourceSpec(t *testing.T) { func TestNewConfigFileToast(t *testing.T) { var ( - dir = "assets/sp_old.yml" + dir = "testdata/sp_old.yml" f = NewFlags() ) f.Spinach = &dir @@ -80,7 +80,7 @@ func TestNewConfigFileToast(t *testing.T) { func TestNewConfigFileNoExists(t *testing.T) { var ( - dir = "assets/spinach.yml" + dir = "testdata/spinach.yml" f = NewFlags() ) f.Spinach = &dir diff --git a/pkg/config/assets/sp1.yml b/pkg/config/testdata/sp1.yml similarity index 100% rename from pkg/config/assets/sp1.yml rename to pkg/config/testdata/sp1.yml diff --git a/pkg/config/assets/sp2.yml b/pkg/config/testdata/sp2.yml similarity index 100% rename from pkg/config/assets/sp2.yml rename to pkg/config/testdata/sp2.yml diff --git a/pkg/config/assets/sp_old.yml b/pkg/config/testdata/sp_old.yml similarity index 100% rename from pkg/config/assets/sp_old.yml rename to pkg/config/testdata/sp_old.yml diff --git a/pkg/popeye.go b/pkg/popeye.go index 1dbbabb3..21c722b3 100644 --- a/pkg/popeye.go +++ b/pkg/popeye.go @@ -290,10 +290,12 @@ type readWriteCloser struct { io.ReadWriter } +// Close close read stream. func (wC readWriteCloser) Close() error { return nil } +// NopWriter fake writer. func NopWriter(i io.ReadWriter) io.ReadWriteCloser { return &readWriteCloser{i} }