Skip to content

Commit

Permalink
Provides an Override to the WATCH_NAMESPACE env variable. (jenkinsci#923
Browse files Browse the repository at this point in the history
)

Co-authored-by: João Valença <[email protected]>
  • Loading branch information
2 people authored and AniketNS committed Feb 5, 2024
1 parent 34dbb37 commit 6294325
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions chart/jenkins-operator/templates/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ spec:
- name: WATCH_NAMESPACE
{{- if .Values.jenkins.enabled }}
value: {{ .Values.jenkins.namespace }}
{{- else if .Values.operator.watchNamespace }}
value: {{ .Values.operator.watchNamespace }}
{{- else }}
valueFrom:
fieldRef:
Expand Down
4 changes: 4 additions & 0 deletions chart/jenkins-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ operator:
# fullnameOverride overrides the deployment name
fullnameOverride: ""

# Select a different namespace to look for the Jenkins CR and deploy Jenkins in. Defaults to the same namespace as
# the operator.
# watchNamespace: "jenkins-namespace"

resources: {}
nodeSelector: {}
tolerations: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,13 @@ Name of resource. The pod name will be <code>jenkins-&lt;name&gt;</code> (name w
<code>namespace</code>
</td>
<td>
default
""
</td>
<td>
Namespace the resources will be deployed to. It's not recommended to use default namespace.
Create new namespace for jenkins (e.g. <code>kubectl create -n jenkins</code>)
Namespace the resources will be deployed to. If omitted, the resources will be deployed to the same namespace as the operator.
It's not recommended to use default namespace. Create new namespace for jenkins (e.g. <code>kubectl create -n jenkins</code>).

<b>Note:</b> If the Jenkins instance is disabled, this property will be ignored. Use the `operator.watchNamespace` property instead.
</td>
</tr>
<tr>
Expand Down

0 comments on commit 6294325

Please sign in to comment.