Use --watch-namespace flag to restrict the namespace to watch

Ref https://github.com/summerwind/actions-runner-controller/issues/377#issuecomment-793172995
This commit is contained in:
Yusuke Kuoka
2021-03-09 09:12:46 +09:00
parent 1753fa3530
commit 1b8a656051
7 changed files with 28 additions and 15 deletions

View File

@@ -131,12 +131,12 @@ func SetupIntegrationTest(ctx context.Context) *testEnvironment {
Expect(err).NotTo(HaveOccurred(), "failed to setup controller")
autoscalerWebhook := &HorizontalRunnerAutoscalerGitHubWebhook{
Client: mgr.GetClient(),
Scheme: scheme.Scheme,
Log: logf.Log,
Recorder: mgr.GetEventRecorderFor("horizontalrunnerautoscaler-controller"),
Name: controllerName("horizontalrunnerautoscalergithubwebhook"),
WatchNamespace: ns.Name,
Client: mgr.GetClient(),
Scheme: scheme.Scheme,
Log: logf.Log,
Recorder: mgr.GetEventRecorderFor("horizontalrunnerautoscaler-controller"),
Name: controllerName("horizontalrunnerautoscalergithubwebhook"),
Namespace: ns.Name,
}
err = autoscalerWebhook.SetupWithManager(mgr)
Expect(err).NotTo(HaveOccurred(), "failed to setup autoscaler webhook")