Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to run - No resource meta found for policy/v1beta1/poddisruptionbudgets #183

Closed
lee-harmonic opened this issue Jul 13, 2021 · 4 comments
Labels
duplicate This issue or pull request already exists

Comments

@lee-harmonic
Copy link




Describe the bug
Starting popeye gives the following error:

Boom! No resource meta found for policy/v1beta1/poddisruptionbudgets

Running kubectl api-resources shows that poddisruptionbudgets is now v1, not v1beta1 (k8s version 1.21.2)

To Reproduce
Steps to reproduce the behavior:

  1. Start a k8s v1.21 cluster
  2. Download popeye v0.9.3 (or v0.8.3)
  3. Untar popeye
  4. Run ./popeye
  5. See error

Expected behavior
Popeye to run and produce the report

Versions (please complete the following information):

  • OS: Linux (Debian 10)
  • Popeye: 0.9.3 and earlier to at least v0.8.3 - v0.7.1 is working
  • K8s: 1.21.2
@lee-harmonic
Copy link
Author

Running the latest docker container image also fails in the same way

@jolet
Copy link

jolet commented Jul 13, 2021

+1

Btw there is possible workaround mentioned in PR #182

Version: 0.9.3
Commit: 2cea939
Date: 2021-06-22T13:19:25Z
Logs: /tmp/popeye.log

here be logs from /tmp/popeye.log

4:05PM DBG Connecting to API Server https://127.0.0.1:6443 4:05PM ERR No resource meta found for policy/v1beta1/poddisruptionbudgets 4:05PM ERR goroutine 1 [running]: runtime/debug.Stack(0x2b01440, 0x1c81f03, 0x0) runtime/debug/stack.go:24 +0x9f github.com/derailed/popeye/cmd.doIt.func1() github.com/derailed/popeye/cmd/root.go:61 +0x1c5 panic(0x1971e40, 0xc000309940) runtime/panic.go:965 +0x1b9 github.com/derailed/popeye/internal.(*Aliases).Init(0xc000552100, 0x1f63960, 0xc0003e8fc0, 0xc000572000, 0x18, 0x30, 0x17, 0x30) github.com/derailed/popeye/internal/alias.go:41 +0xb5f github.com/derailed/popeye/pkg.(*Popeye).Init(0xc000362870, 0x2b01440, 0xc000362870) github.com/derailed/popeye/pkg/popeye.go:95 +0x1e5 github.com/derailed/popeye/cmd.doIt(0x2aeee60, 0x2b30ed0, 0x0, 0x0) github.com/derailed/popeye/cmd/root.go:76 +0x1e5 github.com/spf13/cobra.(*Command).execute(0x2aeee60, 0xc00003a210, 0x0, 0x0, 0x2aeee60, 0xc00003a210) github.com/spf13/cobra@v1.1.1/command.go:854 +0x2c2 github.com/spf13/cobra.(*Command).ExecuteC(0x2aeee60, 0x0, 0xc00006c778, 0xc00081ff78) github.com/spf13/cobra@v1.1.1/command.go:958 +0x375 github.com/spf13/cobra.(*Command).Execute(...) github.com/spf13/cobra@v1.1.1/command.go:895 github.com/derailed/popeye/cmd.Execute() github.com/derailed/popeye/cmd/root.go:47 +0x31 main.main() github.com/derailed/popeye/main.go:26 +0x25

@jolet
Copy link

jolet commented Jul 14, 2021

here are the changes to make it work on K8s Rev: v1.21.1
switch "policy/v1beta1/poddisruptionbudgets" with "policy/v1/poddisruptionbudgets"
changed files are
pkg/popeye.go
internal/dag/pdb.go

here git diff.

diff --git a/internal/dag/pdb.go b/internal/dag/pdb.go
index 0ebe266..ad1b39a 100644
--- a/internal/dag/pdb.go
+++ b/internal/dag/pdb.go
@@ -43,7 +43,7 @@ func fetchPodDisruptionBudgets(ctx context.Context) (*polv1beta1.PodDisruptionBu
        }
 
        var res dao.Resource
-       res.Init(f, client.NewGVR("policy/v1beta1/poddisruptionbudgets"))
+       res.Init(f, client.NewGVR("policy/v1/poddisruptionbudgets"))
        oo, err := res.List(ctx)
        if err != nil {
                return nil, err
diff --git a/pkg/popeye.go b/pkg/popeye.go
index 78b44d8..a74007a 100644
--- a/pkg/popeye.go
+++ b/pkg/popeye.go
@@ -128,7 +128,7 @@ func (p *Popeye) scannedGVRs(rev *version.Info) []string {
                "apps/v1/replicasets",
                "apps/v1/daemonsets",
                "apps/v1/statefulsets",
-               "policy/v1beta1/poddisruptionbudgets",
+               "policy/v1/poddisruptionbudgets",
                "policy/v1beta1/podsecuritypolicies",
                "networking.k8s.io/v1/networkpolicies",
                "autoscaling/v1/horizontalpodautoscalers",
@@ -201,7 +201,7 @@ func (p *Popeye) sanitizers(rev *version.Info) map[string]scrubFn {
                "autoscaling/v1/horizontalpodautoscalers":          scrub.NewHorizontalPodAutoscaler,
                "networking.k8s.io/v1/ingresses":                   scrub.NewIngress,
                "networking.k8s.io/v1/networkpolicies":             scrub.NewNetworkPolicy,
-               "policy/v1beta1/poddisruptionbudgets":              scrub.NewPodDisruptionBudget,
+               "policy/v1/poddisruptionbudgets":              scrub.NewPodDisruptionBudget,
                "policy/v1beta1/podsecuritypolicies":               scrub.NewPodSecurityPolicy,
                "rbac.authorization.k8s.io/v1/clusterroles":        scrub.NewClusterRole,
                "rbac.authorization.k8s.io/v1/clusterrolebindings": scrub.NewClusterRoleBinding,

after that rebuild and run with

go build && ./popeye

@derailed derailed added bug Something isn't working duplicate This issue or pull request already exists and removed bug Something isn't working labels Jul 15, 2021
@derailed
Copy link
Owner

Dup #163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants