This commit is contained in:
Michal Wozniak 2022-07-12 10:16:00 +02:00
parent 2730d285cf
commit 778b8300bc

View File

@ -52,7 +52,6 @@ const (
type PodGCController struct { type PodGCController struct {
kubeClient clientset.Interface kubeClient clientset.Interface
ctx context.Context
podLister corelisters.PodLister podLister corelisters.PodLister
podListerSynced cache.InformerSynced podListerSynced cache.InformerSynced
@ -82,11 +81,6 @@ func NewPodGC(ctx context.Context, kubeClient clientset.Interface, podInformer c
return gcc return gcc
} }
func (gcc *PodGCController) deletePod(ctx context.Context, namespace, name string) error {
klog.InfoS("PodGC is force deleting Pod", "pod", klog.KRef(namespace, name))
return gcc.kubeClient.CoreV1().Pods(namespace).Delete(ctx, name, *metav1.NewDeleteOptions(0))
}
func (gcc *PodGCController) Run(ctx context.Context) { func (gcc *PodGCController) Run(ctx context.Context) {
defer utilruntime.HandleCrash() defer utilruntime.HandleCrash()
@ -303,3 +297,8 @@ func (o byCreationTimestamp) Less(i, j int) bool {
} }
return o[i].CreationTimestamp.Before(&o[j].CreationTimestamp) return o[i].CreationTimestamp.Before(&o[j].CreationTimestamp)
} }
func (gcc *PodGCController) deletePod(ctx context.Context, namespace, name string) error {
klog.InfoS("PodGC is force deleting Pod", "pod", klog.KRef(namespace, name))
return gcc.kubeClient.CoreV1().Pods(namespace).Delete(ctx, name, *metav1.NewDeleteOptions(0))
}