Merge pull request #44324 from shiywang/fix-subresource

Automatic merge from submit-queue (batch tested with PRs 43900, 44152, 44324)

make deployment unit tests need to respect subresources

Fixes #42569
I check all the unit test code related to `Matches` method, seems there's only one line we could change to not break previous testing logic
@kargakis ptal, thanks

/assign @kargakis
pull/6/head
Kubernetes Submit Queue 2017-04-11 07:57:20 -07:00 committed by GitHub
commit 44131a3658
1 changed files with 1 additions and 1 deletions

View File

@ -226,7 +226,7 @@ func (f *fixture) run_(deploymentName string, startInformers bool, expectError b
}
expectedAction := f.actions[i]
if !expectedAction.Matches(action.GetVerb(), action.GetResource().Resource) {
if !(expectedAction.Matches(action.GetVerb(), action.GetResource().Resource) && action.GetSubresource() == expectedAction.GetSubresource()) {
f.t.Errorf("Expected\n\t%#v\ngot\n\t%#v", expectedAction, action)
continue
}