From bf70b19355cc7fe7d7ea2fe18b422a622440578d Mon Sep 17 00:00:00 2001 From: carlory Date: Mon, 26 Aug 2019 21:23:40 +0800 Subject: [PATCH] fix static check failures in staging pkg Kubernetes-commit: d3578f465d1e41f6fb022f64117f51cbed90fd9d --- controller_test.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/controller_test.go b/controller_test.go index b24d87ed..c6f103da 100644 --- a/controller_test.go +++ b/controller_test.go @@ -175,8 +175,8 @@ func checkAction(expected, actual core.Action, t *testing.T) { } switch a := actual.(type) { - case core.CreateAction: - e, _ := expected.(core.CreateAction) + case core.CreateActionImpl: + e, _ := expected.(core.CreateActionImpl) expObject := e.GetObject() object := a.GetObject() @@ -184,8 +184,8 @@ func checkAction(expected, actual core.Action, t *testing.T) { t.Errorf("Action %s %s has wrong object\nDiff:\n %s", a.GetVerb(), a.GetResource().Resource, diff.ObjectGoPrintSideBySide(expObject, object)) } - case core.UpdateAction: - e, _ := expected.(core.UpdateAction) + case core.UpdateActionImpl: + e, _ := expected.(core.UpdateActionImpl) expObject := e.GetObject() object := a.GetObject() @@ -193,8 +193,8 @@ func checkAction(expected, actual core.Action, t *testing.T) { t.Errorf("Action %s %s has wrong object\nDiff:\n %s", a.GetVerb(), a.GetResource().Resource, diff.ObjectGoPrintSideBySide(expObject, object)) } - case core.PatchAction: - e, _ := expected.(core.PatchAction) + case core.PatchActionImpl: + e, _ := expected.(core.PatchActionImpl) expPatch := e.GetPatch() patch := a.GetPatch() @@ -202,6 +202,9 @@ func checkAction(expected, actual core.Action, t *testing.T) { t.Errorf("Action %s %s has wrong patch\nDiff:\n %s", a.GetVerb(), a.GetResource().Resource, diff.ObjectGoPrintSideBySide(expPatch, patch)) } + default: + t.Errorf("Uncaptured Action %s %s, you should explicitly add a case to capture it", + actual.GetVerb(), actual.GetResource().Resource) } }