mirror of
https://github.com/stakater/Reloader.git
synced 2026-08-23 22:16:45 +00:00
added watch namespaces support
This commit is contained in:
@@ -9,6 +9,25 @@ import (
|
||||
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
)
|
||||
|
||||
func TestBuildDefaultNamespaces(t *testing.T) {
|
||||
if got := buildDefaultNamespaces(nil); got != nil {
|
||||
t.Errorf("empty input should return nil, got %v", got)
|
||||
}
|
||||
if got := buildDefaultNamespaces([]string{}); got != nil {
|
||||
t.Errorf("empty slice should return nil, got %v", got)
|
||||
}
|
||||
|
||||
got := buildDefaultNamespaces([]string{"team-a", "team-b", "team-c"})
|
||||
if len(got) != 3 {
|
||||
t.Fatalf("expected 3 entries, got %d", len(got))
|
||||
}
|
||||
for _, ns := range []string{"team-a", "team-b", "team-c"} {
|
||||
if _, ok := got[ns]; !ok {
|
||||
t.Errorf("missing namespace %q in %v", ns, got)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestAddOptionalSchemesRegistersCSI(t *testing.T) {
|
||||
// Reset to a clean scheme for the test.
|
||||
runtimeScheme = runtime.NewScheme()
|
||||
|
||||
Reference in New Issue
Block a user