mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Merge pull request #13519 from ironcladlou/test-fix
Refactor test to use new fake reactors
This commit is contained in:
commit
efdcd9f8e8
@ -689,24 +689,22 @@ func TestUpdate_progressTimeout(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
TODO: this was a bad commit @ironcladlou at red hat needs to fix this.
|
|
||||||
func TestUpdate_assignOriginalAnnotation(t *testing.T) {
|
func TestUpdate_assignOriginalAnnotation(t *testing.T) {
|
||||||
oldRc := oldRc(1, 1)
|
oldRc := oldRc(1, 1)
|
||||||
delete(oldRc.Annotations, originalReplicasAnnotation)
|
delete(oldRc.Annotations, originalReplicasAnnotation)
|
||||||
newRc := newRc(1, 1)
|
newRc := newRc(1, 1)
|
||||||
var updatedOldRc *api.ReplicationController
|
var updatedOldRc *api.ReplicationController
|
||||||
fake := &testclient.Fake{}
|
fake := &testclient.Fake{}
|
||||||
fake.ReactFn = func(action testclient.Action) (runtime.Object, error) {
|
fake.AddReactor("*", "*", func(action testclient.Action) (handled bool, ret runtime.Object, err error) {
|
||||||
switch a := action.(type) {
|
switch a := action.(type) {
|
||||||
case testclient.GetAction:
|
case testclient.GetAction:
|
||||||
return oldRc, nil
|
return true, oldRc, nil
|
||||||
case testclient.UpdateAction:
|
case testclient.UpdateAction:
|
||||||
updatedOldRc = a.GetObject().(*api.ReplicationController)
|
updatedOldRc = a.GetObject().(*api.ReplicationController)
|
||||||
return updatedOldRc, nil
|
return true, updatedOldRc, nil
|
||||||
}
|
}
|
||||||
return nil, nil
|
return false, nil, nil
|
||||||
}
|
})
|
||||||
updater := &RollingUpdater{
|
updater := &RollingUpdater{
|
||||||
c: fake,
|
c: fake,
|
||||||
ns: "default",
|
ns: "default",
|
||||||
@ -745,7 +743,6 @@ func TestUpdate_assignOriginalAnnotation(t *testing.T) {
|
|||||||
t.Fatalf("expected annotation value %s, got %s", e, a)
|
t.Fatalf("expected annotation value %s, got %s", e, a)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
// TestRollingUpdater_cleanupWithClients ensures that the cleanup policy is
|
// TestRollingUpdater_cleanupWithClients ensures that the cleanup policy is
|
||||||
// correctly implemented.
|
// correctly implemented.
|
||||||
|
Loading…
Reference in New Issue
Block a user