From c4e97d600da1e9a1aaa0856e41d9940fcb5d7c72 Mon Sep 17 00:00:00 2001 From: Sebastien Le Digabel Date: Sun, 17 Oct 2021 21:54:32 +0100 Subject: [PATCH] feat: Have githubwebhook monitor a single namespace (#828) * feat: Have githubwebhook monitor a single namespace When using `scope.singleNamespace: true` in Helm, expected behaviour is that the github webhook server behaves the same way as the controller. The current behaviour is that the webhook server monitors all the namespaces. * Changing the chart README.md to reflect the scope The documentation now mentions that both the controller and the github webhook server will make use of the `scope.watchNamespace` field if `scope.singleNamespace` is set to `true`. Co-authored-by: Sebastien Le Digabel --- charts/actions-runner-controller/README.md | 2 +- .../templates/githubwebhook.deployment.yaml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/actions-runner-controller/README.md b/charts/actions-runner-controller/README.md index 696dcd21..3b3a6dce 100644 --- a/charts/actions-runner-controller/README.md +++ b/charts/actions-runner-controller/README.md @@ -55,7 +55,7 @@ All additional docs are kept in the `docs/` folder, this README is solely for do | `tolerations` | Set the controller pod tolerations | | | `env` | Set environment variables for the controller container | | | `priorityClassName` | Set the controller pod priorityClassName | | -| `scope.watchNamespace` | Tells the controller which namespace to watch if `scope.singleNamespace` is true | | +| `scope.watchNamespace` | Tells the controller and the github webhook server which namespace to watch if `scope.singleNamespace` is true | `Release.Namespace` (the default namespace of the helm chart). | | `scope.singleNamespace` | Limit the controller to watch a single namespace | false | | `githubWebhookServer.logLevel` | Set the log level of the githubWebhookServer container | | | `githubWebhookServer.replicaCount` | Set the number of webhook server pods | 1 | diff --git a/charts/actions-runner-controller/templates/githubwebhook.deployment.yaml b/charts/actions-runner-controller/templates/githubwebhook.deployment.yaml index e88e8c54..008aa842 100644 --- a/charts/actions-runner-controller/templates/githubwebhook.deployment.yaml +++ b/charts/actions-runner-controller/templates/githubwebhook.deployment.yaml @@ -42,6 +42,9 @@ spec: {{- if .Values.githubWebhookServer.logLevel }} - "--log-level={{ .Values.githubWebhookServer.logLevel }}" {{- end }} + {{- if .Values.scope.singleNamespace }} + - "--watch-namespace={{ default .Release.Namespace .Values.scope.watchNamespace }}" + {{- end }} command: - "/github-webhook-server" env: