From 01f1cf3c96806e0c7b1e6de7d73e07f794470d91 Mon Sep 17 00:00:00 2001 From: Haines Chan Date: Mon, 27 May 2019 17:10:30 +0800 Subject: [PATCH] Add test cases for a helper function in controller manager --- cmd/controller-manager/app/helper_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cmd/controller-manager/app/helper_test.go b/cmd/controller-manager/app/helper_test.go index 9bc3eeaba29..ea74c4964f2 100644 --- a/cmd/controller-manager/app/helper_test.go +++ b/cmd/controller-manager/app/helper_test.go @@ -60,6 +60,20 @@ func TestIsControllerEnabled(t *testing.T) { disabledByDefaultControllers: []string{"delta", "echo"}, expected: false, }, + { + name: "on by star, not off by name", + controllerName: "alpha", + controllers: []string{"*", "-charlie"}, + disabledByDefaultControllers: []string{"delta", "echo"}, + expected: true, + }, + { + name: "off by name with star", + controllerName: "charlie", + controllers: []string{"*", "-charlie"}, + disabledByDefaultControllers: []string{"delta", "echo"}, + expected: false, + }, { name: "off by default implicit, no star", controllerName: "foxtrot",