File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
pkg/controller/disruption Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ import (
21
21
"time"
22
22
23
23
apps "k8s.io/api/apps/v1beta1"
24
- "k8s.io/api/core/v1"
24
+ v1 "k8s.io/api/core/v1"
25
25
"k8s.io/api/extensions/v1beta1"
26
26
policy "k8s.io/api/policy/v1beta1"
27
27
apiequality "k8s.io/apimachinery/pkg/api/equality"
@@ -363,7 +363,19 @@ func (dc *DisruptionController) updateDb(old, cur interface{}) {
363
363
}
364
364
365
365
func (dc * DisruptionController ) removeDb (obj interface {}) {
366
- pdb := obj .(* policy.PodDisruptionBudget )
366
+ pdb , ok := obj .(* policy.PodDisruptionBudget )
367
+ if ! ok {
368
+ tombstone , ok := obj .(cache.DeletedFinalStateUnknown )
369
+ if ! ok {
370
+ klog .Errorf ("Couldn't get object from tombstone %+v" , obj )
371
+ return
372
+ }
373
+ pdb , ok = tombstone .Obj .(* policy.PodDisruptionBudget )
374
+ if ! ok {
375
+ klog .Errorf ("Tombstone contained object that is not a pdb %+v" , obj )
376
+ return
377
+ }
378
+ }
367
379
klog .V (4 ).Infof ("remove DB %q" , pdb .Name )
368
380
dc .enqueuePdb (pdb )
369
381
}
You can’t perform that action at this time.
0 commit comments