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

use policy/v1 instead of policy/v1beta1 #2732

Merged
merged 1 commit into from
Jun 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/model/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ var Registry = map[string]ResourceMeta{
},

// Policy...
"policy/v1beta1/poddisruptionbudgets": {
"policy/v1/poddisruptionbudgets": {
Renderer: &render.PodDisruptionBudget{},
},

Expand Down
4 changes: 2 additions & 2 deletions internal/render/pdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/derailed/k9s/internal/client"
"github.com/derailed/k9s/internal/model1"
"github.com/derailed/tview"
v1beta1 "k8s.io/api/policy/v1beta1"
v1 "k8s.io/api/policy/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr"
Expand Down Expand Up @@ -44,7 +44,7 @@ func (p PodDisruptionBudget) Render(o interface{}, ns string, r *model1.Row) err
if !ok {
return fmt.Errorf("expected PodDisruptionBudget, but got %T", o)
}
var pdb v1beta1.PodDisruptionBudget
var pdb v1.PodDisruptionBudget
err := runtime.DefaultUnstructuredConverter.FromUnstructured(raw.Object, &pdb)
if err != nil {
return err
Expand Down
6 changes: 3 additions & 3 deletions internal/render/testdata/pdb.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"apiVersion": "policy/v1beta1",
"apiVersion": "policy/v1",
"kind": "PodDisruptionBudget",
"metadata": {
"annotations": {
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"policy/v1beta1\",\"kind\":\"PodDisruptionBudget\",\"metadata\":{\"annotations\":{},\"name\":\"fred\",\"namespace\":\"default\"},\"spec\":{\"minAvailable\":2,\"selector\":{\"matchLabels\":{\"app\":\"nginx\"}}}}\n"
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"policy/v1\",\"kind\":\"PodDisruptionBudget\",\"metadata\":{\"annotations\":{},\"name\":\"fred\",\"namespace\":\"default\"},\"spec\":{\"minAvailable\":2,\"selector\":{\"matchLabels\":{\"app\":\"nginx\"}}}}\n"
},
"creationTimestamp": "2019-08-31T03:48:10Z",
"generation": 1,
"name": "fred",
"namespace": "default",
"resourceVersion": "49885429",
"selfLink": "/apis/policy/v1beta1/namespaces/default/poddisruptionbudgets/fred",
"selfLink": "/apis/policy/v1/namespaces/default/poddisruptionbudgets/fred",
"uid": "26b6cf70-cba2-11e9-990f-42010a800218"
},
"spec": {
Expand Down
2 changes: 1 addition & 1 deletion internal/xray/tree_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ func toEmoji(gvr string) string {
return "👨🏻‍"
case "networking.k8s.io/v1/networkpolicies":
return "📕"
case "policy/v1beta1/poddisruptionbudgets":
case "policy/v1/poddisruptionbudgets":
return "🏷 "
case "policy/v1beta1/podsecuritypolicies":
return "👮‍♂️"
Expand Down