Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sickhub/cronjobs] Support release namespace override #59

Merged
merged 1 commit into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sickhub/cronjobs/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: cronjobs
description: A generic helm cronjob chart for kubernetes
type: application
version: 0.1.7
version: 0.2.0
appVersion: latest
home: https://github.com/SickHub
icon: https://raw.githubusercontent.com/SickHub/charts/master/sickhub/cronjobs/icon.png
Expand Down
7 changes: 7 additions & 0 deletions sickhub/cronjobs/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,10 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Namespace to be released into
*/}}
{{- define "cronjobs.namespace" -}}
{{- default .Release.Namespace .Values.namespaceOverride }}
{{- end }}
2 changes: 2 additions & 0 deletions sickhub/cronjobs/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{- $chart_name := include "cronjobs.fullname" . }}
{{- $chart_labels := include "cronjobs.labels" . }}
{{- $namespace := include "cronjobs.namespace" . }}

{{- if .Values.configMaps }}
{{- range $name, $map := .Values.configMaps }}
Expand All @@ -9,6 +10,7 @@ apiVersion: "v1"
kind: "ConfigMap"
metadata:
name: {{ $chart_name }}-{{ $name }}
namespace: {{ $namespace }}
labels:
{{- $chart_labels | nindent 4 }}
annotations:
Expand Down
2 changes: 2 additions & 0 deletions sickhub/cronjobs/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{{- $chart_labels := include "cronjobs.labels" . }}
{{- $chart_selector_labels := include "cronjobs.selectorLabels" . }}
{{- $service_account_name := include "cronjobs.serviceAccountName" . }}
{{- $namespace := include "cronjobs.namespace" . }}
{{- $registry := .Values.image.registry }}
{{- $tag := .Values.image.tag | default .Chart.AppVersion }}
{{- $image_pull_secrets := .Values.imagePullSecrets }}
Expand All @@ -22,6 +23,7 @@ apiVersion: {{ $api_version }}
kind: CronJob
metadata:
name: {{ $chart_name }}-{{ $name }}
namespace: {{ $namespace }}
labels:
{{- $chart_labels | nindent 4 }}
annotations:
Expand Down
3 changes: 3 additions & 0 deletions sickhub/cronjobs/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{{- $chart_name := include "cronjobs.fullname" . }}
{{- $chart_labels := include "cronjobs.labels" . }}
{{- $namespace := include "cronjobs.namespace" . }}

{{- if .Values.dockerConfigJson }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ $chart_name }}-registry
namespace: {{ $namespace }}
labels:
{{- $chart_labels | nindent 4 }}
annotations:
Expand All @@ -22,6 +24,7 @@ apiVersion: v1
kind: Secret
metadata:
name: {{ $chart_name }}-{{ $name }}
namespace: {{ $namespace }}
labels:
{{- $chart_labels | nindent 4 }}
annotations:
Expand Down
1 change: 1 addition & 0 deletions sickhub/cronjobs/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "cronjobs.serviceAccountName" . }}
namespace: {{ include "cronjobs.namespace" . }}
labels:
{{- include "cronjobs.labels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
Expand Down
1 change: 1 addition & 0 deletions sickhub/cronjobs/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
nameOverride: ""
fullnameOverride: ""
namespaceOverride: ""

image:
registry: docker.io
Expand Down
Loading