Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Use policy v1 API for Kubernetes 1.25 #195

Merged
merged 1 commit into from
Mar 22, 2023
Merged
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
4 changes: 2 additions & 2 deletions pkg/collectors/kube/pod/pods.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/sirupsen/logrus"
"golang.org/x/sync/errgroup"

policy "k8s.io/api/policy/v1beta1"
policy "k8s.io/api/policy/v1"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/runtime"
Expand Down Expand Up @@ -200,7 +200,7 @@ func (c *client) Evict(ctx context.Context, pod *Pod) error {
return errors.Errorf("missing name")
}

err := c.kube.CoreV1().Pods(pod.Namespace).Evict(ctx, &policy.Eviction{
err := c.kube.CoreV1().Pods(pod.Namespace).EvictV1(ctx, &policy.Eviction{
ObjectMeta: meta.ObjectMeta{
Name: pod.Name,
Namespace: pod.Namespace,
Expand Down