Skip to content

Commit

Permalink
Merge pull request #285 from derailed/popeye/release_v0.20.3
Browse files Browse the repository at this point in the history
Popeye/release v0.20.3
  • Loading branch information
derailed authored Feb 21, 2024
2 parents dd8eafd + f0630f7 commit c4e44b6
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NAME := popeye
PACKAGE := github.com/derailed/$(NAME)
VERSION := v0.20.2
VERSION := v0.20.3
GIT := $(shell git rev-parse --short HEAD)
DATE := $(shell date +%FT%T%Z)
IMG_NAME := derailed/popeye
Expand Down
45 changes: 25 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,31 @@ Popeye is available on Linux, OSX and Windows platforms.

---

## The Command Line

You can use Popeye wide open or using a spinach yaml config to
tune your linters. Details about the Popeye configuration file are below.

```shell
# Dump version info and logs location
popeye version
# Popeye a cluster using your current kubeconfig environment.
# NOTE! This will run Popeye in the context namespace if set or like kubectl will use the default namespace
popeye
# Run Popeye in the `fred` namespace
popeye -n fred
# Run Popeye in all namespaces
popeye -A
# Popeye uses a spinach config file of course! aka spinachyaml!
popeye -f spinach.yaml
# Popeye a cluster using a kubeconfig context.
popeye --context olive
# Stuck?
popeye help
```

---

## Linters

Popeye scans your cluster for best practices and potential issues.
Expand Down Expand Up @@ -274,26 +299,6 @@ cat /tmp/popeye/my_report.txt

---

## The Command Line

You can use Popeye wide open or using a spinach yaml config to
tune your linters. Details about the Popeye configuration file are below.

```shell
# Dump version info and logs location
popeye version
# Popeye a cluster using your current kubeconfig environment.
popeye
# Popeye uses a spinach config file of course! aka spinachyaml!
popeye -f spinach.yaml
# Popeye a cluster using a kubeconfig context.
popeye --context olive
# Stuck?
popeye help
```

---

## Output Formats

Popeye can generate linter reports in a variety of formats. You can use the -o cli option and pick your poison from there.
Expand Down
25 changes: 25 additions & 0 deletions change_logs/release_v0.20.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<img src="https://raw.githubusercontent.com/derailed/popeye/master/assets/popeye_logo.png" align="right" width="200" height="auto"/>

# Release v0.20.3

## Notes

Thank you to all that contributed with flushing out issues and enhancements for Popeye! I'll try to mark some of these issues as fixed. But if you don't mind grab the latest rev and see if we're happier with some of the fixes! If you've filed an issue please help me verify and close. Your support, kindness and awesome suggestions to make Popeye better is as ever very much noticed and appreciated!

This project offers a GitHub Sponsor button (over here 👆). As you well know this is not pimped out by big corps with deep pockets. If you feel `Popeye` is saving you cycles diagnosing potential cluster issues please consider sponsoring this project!! It does go a long way in keeping our servers lights on and beers in our fridge.

Also if you dig this tool, please make some noise on social! [@kitesurfer](https://twitter.com/kitesurfer)

---

## Maintenance Release

---

## Resolved Issues

. [#284](https://github.com/derailed/popeye/issues/284) Db get failed for ""

---

<img src="https://raw.githubusercontent.com/derailed/popeye/master/assets/imhotep_logo.png" width="32" height="auto"/>&nbsp; © 2024 Imhotep Software LLC. All materials licensed under [Apache v2.0](http://www.apache.org/licenses/LICENSE-2.0)
7 changes: 4 additions & 3 deletions internal/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ func NewDB(db *memdb.MemDB) *DB {

func (db *DB) ITFor(gvr types.GVR) (*memdb.Txn, memdb.ResultIterator, error) {
if gvr == types.BlankGVR {
panic(fmt.Errorf("invalid table"))
return nil, nil, fmt.Errorf("invalid table")
}

txn := db.Txn(false)
it, err := txn.Get(gvr.String(), "id")
if err != nil {
Expand All @@ -45,7 +46,7 @@ func (db *DB) MustITForNS(gvr types.GVR, ns string) (*memdb.Txn, memdb.ResultIte
txn := db.Txn(false)
it, err := txn.Get(gvr.String(), "ns", ns)
if err != nil {
panic(fmt.Errorf("Db get failed for %q: %w", gvr, err))
panic(fmt.Errorf("db ns iterator failed for %q: %w", gvr, err))
}

return txn, it
Expand All @@ -55,7 +56,7 @@ func (db *DB) MustITFor(gvr types.GVR) (*memdb.Txn, memdb.ResultIterator) {
txn := db.Txn(false)
it, err := txn.Get(gvr.String(), "id")
if err != nil {
panic(fmt.Errorf("Db get failed for %q: %w", gvr, err))
panic(fmt.Errorf("db iterator failed for %q: %w", gvr, err))
}

return txn, it
Expand Down
2 changes: 1 addition & 1 deletion internal/lint/cronjob.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func jobResourceUsage(ctx context.Context, dba *db.DB, c Collector, jobs []*batc
mx.RequestMEM.Add(mem)

pmx, err := dba.FindPMX(fqn)
if err != nil {
if err != nil || pmx == nil {
continue
}
for _, cx := range pmx.Containers {
Expand Down
9 changes: 6 additions & 3 deletions internal/lint/gw.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/derailed/popeye/internal/client"
"github.com/derailed/popeye/internal/db"
"github.com/derailed/popeye/internal/issues"
"github.com/rs/zerolog/log"
gwv1 "sigs.k8s.io/gateway-api/apis/v1"
)

Expand Down Expand Up @@ -47,9 +48,11 @@ func (s *Gateway) Lint(ctx context.Context) error {
}

func (s *Gateway) checkRefs(ctx context.Context, gw *gwv1.Gateway) {
txn := s.db.Txn(false)
defer txn.Abort()
txn, it := s.db.MustITFor(internal.Glossary[internal.GWC])
txn, it, err := s.db.ITFor(internal.Glossary[internal.GWC])
if err != nil {
log.Warn().Err(err).Msg("no gateway class located. Skipping gw ref check")
return
}
defer txn.Abort()

for o := it.Next(); o != nil; o = it.Next() {
Expand Down

0 comments on commit c4e44b6

Please sign in to comment.