fix: resource lifecycle

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2020-07-09 15:12:20 +08:00
parent 7516019be5
commit ed8bb437e8
9 changed files with 335 additions and 123 deletions

View File

@@ -94,7 +94,11 @@ func (f *fixture) newController() (*Controller, ksinformers.SharedInformerFactor
}
}
c := NewController(f.k8sclient, f.ksclient, nil, ksinformers.Iam().V1alpha2().Users(), nil, nil, k8sinformers.Core().V1().ConfigMaps(), ldapClient, false)
c := NewController(f.k8sclient, f.ksclient, nil,
ksinformers.Iam().V1alpha2().Users(),
nil, nil,
k8sinformers.Core().V1().ConfigMaps(),
ldapClient, false)
c.userSynced = alwaysReady
c.recorder = &record.FakeRecorder{}
@@ -209,9 +213,7 @@ func checkAction(expected, actual core.Action, t *testing.T) {
func filterInformerActions(actions []core.Action) []core.Action {
var ret []core.Action
for _, action := range actions {
if action.Matches("list", "users") ||
action.Matches("list", "configmaps") ||
action.Matches("watch", "users") {
if !action.Matches("update", "users") {
continue
}
ret = append(ret, action)