Skip to content

Commit

Permalink
Unify and use standard labels - Fixes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
liam-mackie committed Jul 29, 2024
1 parent f426530 commit 23a6105
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 30 deletions.
2 changes: 1 addition & 1 deletion charts/octopus-deploy/charts/mssql/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If release name contains chart name it will be used as a full name.
{{/* Selector Labels for mssql */}}
{{- define "mssql.selectorLabels" -}}
{{include "labels" . }}
component: mssql
app.kubernetes.io/component: mssql
{{- end -}}

{{- define "mssql.storageClass" -}}
Expand Down
10 changes: 5 additions & 5 deletions charts/octopus-deploy/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ Create chart name and version as used by the chart label.
Common Labels
*/}}
{{- define "labels" -}}
app: {{ include "octopus.name" . }}
chart: {{ include "octopus.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
app.kubernetes.io/name: {{ include "octopus.name" . }}
helm.sh/chart: {{ include "octopus.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}

{{/* Selector Labels for octopus */}}
{{- define "octopus.selectorLabels" -}}
{{include "labels" . }}
component: octopus-server
app.kubernetes.io/component: octopus-server
{{- end -}}

{{/*
Expand Down
5 changes: 1 addition & 4 deletions charts/octopus-deploy/templates/dockerHubSecret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ kind: Secret
metadata:
name: dockerhubcreds
labels:
app: {{ template "octopus.name" . }}
chart: {{ template "octopus.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- include "labels" . | nindent 4 }}
data:
.dockerconfigjson: {{.Values.dockerHub.creds}}
type: kubernetes.io/dockerconfigjson
Expand Down
10 changes: 2 additions & 8 deletions charts/octopus-deploy/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ kind: Ingress
metadata:
name: {{ $name }}
labels:
app: {{ template "octopus.name" . }}
chart: {{ template "octopus.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- include "labels" . | nindent 4 }}
{{- if .Values.octopus.ingress.labels }}
{{ toYaml .Values.octopus.ingress.labels | indent 4 }}
{{- end }}
Expand Down Expand Up @@ -56,10 +53,7 @@ kind: Ingress
metadata:
name: octopus-deploy-polling-node{{ . }}
labels:
app: {{ template "octopus.name" $ }}
chart: {{ template "octopus.chart" $ }}
release: {{ $.Release.Name }}
heritage: {{ $.Release.Service }}
{{- include "labels" . | nindent 4 }}
{{- if $.Values.octopus.ingress.pollingTentacles.labels }}
{{ toYaml $.Values.octopus.ingress.pollingTentacles.labels | indent 4 }}
{{- end }}
Expand Down
5 changes: 1 addition & 4 deletions charts/octopus-deploy/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
app: {{ template "octopus.name" . }}
chart: {{ template "octopus.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- include "labels" . | nindent 4 }}
name: {{ template "octopus.fullname" . }}
rules:
{{ toYaml .Values.octopus.rbac.role.rules }}
Expand Down
5 changes: 1 addition & 4 deletions charts/octopus-deploy/templates/rolebinding.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
app: {{ template "octopus.name" . }}
chart: {{ template "octopus.chart" . }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- include "labels" . | nindent 4 }}
name: {{ template "octopus.fullname" . }}
subjects:
- kind: ServiceAccount
Expand Down
5 changes: 1 addition & 4 deletions charts/octopus-deploy/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ metadata:
{{ tpl (toYaml .) $ | indent 4 }}
{{- end }}
labels:
app: {{ template "octopus.name" . }}
chart: {{ template "octopus.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- include "labels" . | nindent 4 }}
{{- if .Values.octopus.serviceAccount.labels }}
{{ toYaml .Values.octopus.serviceAccount.labels | indent 2 }}
{{- end }}
Expand Down

0 comments on commit 23a6105

Please sign in to comment.