mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
Merge pull request #18818 from mqliang/parseordie
Auto commit by PR queue bot
This commit is contained in:
@@ -61,7 +61,7 @@ func New(kubeClient client.Interface, resyncPeriod controller.ResyncPeriodFunc,
|
||||
},
|
||||
}
|
||||
|
||||
terminatedSelector := compileTerminatedPodSelector()
|
||||
terminatedSelector := fields.ParseSelectorOrDie("status.phase!=" + string(api.PodPending) + ",status.phase!=" + string(api.PodRunning) + ",status.phase!=" + string(api.PodUnknown))
|
||||
|
||||
gcc.podStore.Store, gcc.podStoreSyncer = framework.NewInformer(
|
||||
&cache.ListWatch{
|
||||
@@ -115,14 +115,6 @@ func (gcc *GCController) gc() {
|
||||
wait.Wait()
|
||||
}
|
||||
|
||||
func compileTerminatedPodSelector() fields.Selector {
|
||||
selector, err := fields.ParseSelector("status.phase!=" + string(api.PodPending) + ",status.phase!=" + string(api.PodRunning) + ",status.phase!=" + string(api.PodUnknown))
|
||||
if err != nil {
|
||||
panic("terminatedSelector must compile: " + err.Error())
|
||||
}
|
||||
return selector
|
||||
}
|
||||
|
||||
// byCreationTimestamp sorts a list by creation timestamp, using their names as a tie breaker.
|
||||
type byCreationTimestamp []*api.Pod
|
||||
|
||||
|
||||
Reference in New Issue
Block a user