MCPcopy Create free account
hub / github.com/stakater/Reloader / newTestController

Function newTestController

internal/pkg/controller/controller_test.go:52–63  ·  view source on GitHub ↗

newTestController creates a controller for testing without starting informers

(ignoredNamespaces []string, namespaceSelector string)

Source from the content-addressed store, hash-verified

50
51// newTestController creates a controller for testing without starting informers
52func newTestController(ignoredNamespaces []string, namespaceSelector string) *Controller {
53 queue := workqueue.NewTypedRateLimitingQueue(workqueue.DefaultTypedControllerRateLimiter[any]())
54 collectors := metrics.NewCollectors()
55
56 return &Controller{
57 queue: queue,
58 ignoredNamespaces: ignoredNamespaces,
59 namespaceSelector: namespaceSelector,
60 collectors: collectors,
61 resource: "configmaps",
62 }
63}
64
65func TestResourceInIgnoredNamespace(t *testing.T) {
66 tests := []struct {

Calls 1

NewCollectorsFunction · 0.92

Tested by

no test coverage detected