Skip to content

Commit

Permalink
use policy/v1 instead of policy/v1beta1 (#2732)
Browse files Browse the repository at this point in the history
  • Loading branch information
prasadkatti authored Jun 8, 2024
1 parent 8fe7a1a commit c4ff75c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
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

0 comments on commit c4ff75c

Please sign in to comment.