Skip to content

Commit

Permalink
Create gitjob resources only if gitjob is enabled
Browse files Browse the repository at this point in the history
This respects existing behaviour as currently triggered via the Rancher
UI.
If the `gitjob.enabled` switch evaluates to `false`, `gitjob` CRDs will
still be installed, though.
  • Loading branch information
weyfonk committed Jan 30, 2024
1 parent 50f9263 commit 0158a4d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions charts/fleet/templates/deployment_gitjob.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.gitops.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -50,3 +51,4 @@ spec:
{{- if .Values.priorityClassName }}
priorityClassName: "{{.Values.priorityClassName}}"
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/fleet/templates/rbac_gitjob.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.gitops.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -75,3 +76,4 @@ roleRef:
subjects:
- kind: ServiceAccount
name: gitjob
{{- end }}
4 changes: 3 additions & 1 deletion charts/fleet/templates/service_gitjob.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.gitops.enabled }}
apiVersion: v1
kind: Service
metadata:
Expand All @@ -9,4 +10,5 @@ spec:
protocol: TCP
targetPort: 8080
selector:
app: "gitjob"
app: "gitjob"
{{- end }}
2 changes: 2 additions & 0 deletions charts/fleet/templates/serviceaccount_gitjob.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{- if .Values.gitops.enabled }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: gitjob
{{- end }}

0 comments on commit 0158a4d

Please sign in to comment.