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
popeye 0.9.0 with K8S 1.21.0 bug on PodDisruptionBudget - Wrong default API #163
Comments
maybe
|
This makes popeye unusable on 1.21 (unless there’s a workaround that I couldn’t find). IMO, this should be qualified as bug. I’ll see if I can provide a PR for that. |
I came with this diff, but I’m not sure it’ll actually work for < 1.21: diff --git a/pkg/popeye.go b/pkg/popeye.go
index 78b44d8..bda13b8 100644
--- a/pkg/popeye.go
+++ b/pkg/popeye.go
@@ -128,7 +128,6 @@ func (p *Popeye) scannedGVRs(rev *version.Info) []string {
"apps/v1/replicasets",
"apps/v1/daemonsets",
"apps/v1/statefulsets",
- "policy/v1beta1/poddisruptionbudgets",
"policy/v1beta1/podsecuritypolicies",
"networking.k8s.io/v1/networkpolicies",
"autoscaling/v1/horizontalpodautoscalers",
@@ -144,6 +143,12 @@ func (p *Popeye) scannedGVRs(rev *version.Info) []string {
mm = append(mm, "networking.k8s.io/v1/ingresses")
}
+ if rev.Minor == "20+" || rev.Minor == "19+" || rev.Minor == "18+" || rev.Minor == "17+" {
+ mm = append(mm, "policy/v1beta1/poddisruptionbudgets")
+ } else {
+ mm = append(mm, "policy/v1/poddisruptionbudgets")
+ }
+
return mm
}
@@ -213,6 +218,10 @@ func (p *Popeye) sanitizers(rev *version.Info) map[string]scrubFn {
mm["networking.k8s.io/v1beta1/ingresses"] = scrub.NewIngress
}
+ if rev.Minor == "20+" || rev.Minor == "19+" || rev.Minor == "18+" || rev.Minor == "17+" {
+ mm["policy/v1beta1/poddisruptionbudgets"] = scrub.NewPodDisruptionBudget
+ }
+
return mm
} |
Fixed v0.9.4. Thank you all for weighting in! |
This appears to still be happening with popeye v0.9.6 and kubernetes 1.21.3. Also, the category is repeated.
|
Does your "kubectl" version is 1.21.x too ? |
@lee-harmonic Doh - Great catch! Thank you Lee!! Will fix in the next drop. |
Fixed v0.20.0 |
Hi,
Popeye 0.9.0 has been released before Kubernetes K8S 1.21.0.
By default Popeye watch for PodDisruptionBudget resources on K8S API "policy/v1beta1/poddisruptionbudgets"
On K8S 1.21.0, PodDisruptionBudget has been migrated to API "policy/v1/poddisruptionbudgets"
In the next Popeye release, please add a check to force Popeye to watch for PodDisruptionBudget at API "policy/v1beta1/poddisruptionbudgets" for K8S < 1.21.X, and "policy/v1/poddisruptionbudgets" for K8S >= 1.21.X
The text was updated successfully, but these errors were encountered: