Skip to content

Commit

Permalink
a lot of linting and dependency fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
tjungbauer committed Jul 6, 2024
1 parent 8d93a96 commit c9b8dd7
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 208 deletions.
51 changes: 0 additions & 51 deletions clusters/all/base-operators/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,51 +0,0 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "common.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "common.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "common.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "common.labels" -}}
helm.sh/chart: {{ include "common.chart" . }}
{{ include "common.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "common.selectorLabels" -}}
app.kubernetes.io/name: {{ include "common.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
3 changes: 3 additions & 0 deletions clusters/all/project-onboarding/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: proj-onboarding
description: This Chart shall deploy namespaces and their depending resources, like NetworkPolicies or Quotas etc.
version: 1.0.5
dependencies:
- name: tpl
version: ~1.0.0
repository: https://charts.stderr.at/
- name: helper-proj-onboarding
version: ~1.0.0
repository: https://charts.stderr.at/
Expand Down
73 changes: 0 additions & 73 deletions clusters/all/project-onboarding/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,73 +0,0 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "common.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "common.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "common.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "common.labels" -}}
helm.sh/chart: {{ include "common.chart" . }}
{{ include "common.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "common.selectorLabels" -}}
app.kubernetes.io/name: {{ include "common.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "helper.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "common.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Create the name of the role and rolebinding for the serviceaccount
*/}}
{{- define "helper.rolename" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "common.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ metadata:
name: {{ $value_appproject.name | replace "_" "-" }}
namespace: {{ $.Values.global.application_gitops_namespace }}
labels:
{{- include "common.labels" $ | nindent 4 }}
{{- include "tpl.labels" $ | nindent 4 }}
spec:
description: {{ $value_appproject.name | replace "_" "-" }} GitOps Project
clusterResourceWhitelist:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
name: {{ $key | replace "_" "-" }}-rolebinding
namespace: {{ $value.namespace | default "openshift-operators" | quote }}
labels:
{{- include "common.labels" $ | nindent 4 }}
{{- include "tpl.labels" $ | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
name: {{ $key | replace "_" "-" }}-role
namespace: {{ $value.namespace | default "openshift-operators" | quote }}
labels:
{{- include "common.labels" $ | nindent 4 }}
{{- include "tpl.labels" $ | nindent 4 }}
rules:
- apiGroups:
- "*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ dependencies:
version: ~1.0.0
repository: https://charts.stderr.at/
condition: cert-manager.enabled
- name: tpl
version: ~1.0.0
repository: https://charts.stderr.at/
maintainers:
- name: tjungbauer
email: [email protected]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
argocd.argoproj.io/hook-delete-policy: HookSucceeded
argocd.argoproj.io/sync-wave: {{ .syncwave | default 3 | quote }}
labels:
{{- include "common.labels" $ | nindent 4 }}
{{- include "tpl.labels" $ | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
argocd.argoproj.io/hook-delete-policy: HookSucceeded
argocd.argoproj.io/sync-wave: {{ .syncwave | default 3 | quote }}
labels:
{{- include "common.labels" $ | nindent 4 }}
{{- include "tpl.labels" $ | nindent 4 }}
{{- end }}
{{- end }}

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ metadata:
argocd.argoproj.io/hook-delete-policy: HookSucceeded
argocd.argoproj.io/sync-wave: {{ .syncwave | default 3 | quote }}
labels:
{{- include "common.labels" $ | nindent 4 }}
{{- include "tpl.labels" $ | nindent 4 }}
spec:
template:
metadata:
Expand Down
73 changes: 0 additions & 73 deletions clusters/management-cluster/setup-quay/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,73 +0,0 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "compliance.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "compliance.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "compliance.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "compliance.labels" -}}
helm.sh/chart: {{ include "compliance.chart" . }}
{{ include "compliance.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "compliance.selectorLabels" -}}
app.kubernetes.io/name: {{ include "compliance.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "compliance.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "compliance.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Create the name of the role and rolebinding for the serviceaccount
*/}}
{{- define "compliance.rolename" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "compliance.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
name: {{ .bucket.name }}
namespace: {{ .namespace.name }}
labels:
{{- include "common.labels" $ | nindent 4 }}
{{- include "tpl.labels" $ | nindent 4 }}
annotations:
argocd.argoproj.io/sync-wave: {{ .bucket.syncwave | default "2" | quote }}
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
name: init-user
namespace: {{ .namespace.name }}
labels:
{{- include "common.labels" $ | nindent 4 }}
{{- include "tpl.labels" $ | nindent 4 }}
annotations:
argocd.argoproj.io/sync-wave: "2"
argocd.argoproj.io/compare-options: IgnoreExtraneous
Expand Down

0 comments on commit c9b8dd7

Please sign in to comment.