Skip to content

Commit 1725f17

Browse files
committed
fixed namespace behavior issue
1 parent 4f8b22e commit 1725f17

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

internal/pkg/controller/controller.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,7 @@ func (c *Controller) Update(old interface{}, new interface{}) {
201201

202202
// Delete function to add an object to the queue in case of deleting a resource
203203
func (c *Controller) Delete(old interface{}) {
204-
switch object := old.(type) {
205-
case *v1.Namespace:
206-
c.removeSelectedNamespaceFromCache(*object)
207-
return
208-
case *csiv1.SecretProviderClassPodStatus:
204+
if _, ok := old.(*csiv1.SecretProviderClassPodStatus); ok {
209205
return
210206
}
211207

@@ -218,6 +214,12 @@ func (c *Controller) Delete(old interface{}) {
218214
})
219215
}
220216
}
217+
218+
switch object := old.(type) {
219+
case *v1.Namespace:
220+
c.removeSelectedNamespaceFromCache(*object)
221+
return
222+
}
221223
}
222224

223225
// Run function for controller which handles the queue

0 commit comments

Comments
 (0)