Skip to content

Commit

Permalink
Merge pull request #13 from infrahq/mxyng/labels-annotations
Browse files Browse the repository at this point in the history
fix(infra): labels, podLabels, and podAnnotations
  • Loading branch information
mxyng authored Dec 9, 2022
2 parents 32f7f52 + b125f17 commit ef7f9c4
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 3 deletions.
39 changes: 39 additions & 0 deletions charts/infra-server/ci/test-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
global:
labels:
global-label: value

podLabels:
global-pod-label: value

podAnnotations:
global-pod-annotation: value

server:
labels:
server-label: value

podLabels:
server-pod-label: value

podAnnotations:
server-pod-annotation: value

ui:
labels:
ui-label: value

podLabels:
ui-pod-label: value

podAnnotations:
ui-pod-annotation: value

postgres:
labels:
postgres-label: value

podLabels:
postgres-pod-label: value

podAnnotations:
postgres-pod-annotation: value
2 changes: 1 addition & 1 deletion charts/infra/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: infra
description: A Helm chart for Infra connector. For Infra server charts, use infra-server.
type: application
version: 0.1.0
version: 0.1.1
appVersion: 0.19.0
9 changes: 9 additions & 0 deletions charts/infra/ci/access-key-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,14 @@ config:
server:
url: localhost

labels:
label: value

podLabels:
pod-label: value

podAnnotations:
pod-annotation: value

service:
type: ClusterIP
7 changes: 5 additions & 2 deletions charts/infra/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ app.infrahq.com/component: connector
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- if .Values.labels }}
{{ toYaml .Values.labels }}
{{- end }}
{{- end }}

{{/*
Expand Down Expand Up @@ -69,7 +72,7 @@ Pod labels
{{- define "connector.podLabels" -}}
{{- include "connector.selectorLabels" . }}
{{- if .Values.podLabels }}
{{- toYaml .Values.podLabels }}
{{ toYaml .Values.podLabels }}
{{- end }}
{{- end }}

Expand All @@ -79,6 +82,6 @@ Pod annotations
{{- define "connector.podAnnotations" -}}
rollme: {{ include (print .Template.BasePath "/configmap.yaml") . | sha1sum }}
{{- if .Values.podAnnotations }}
{{- toYaml .Values.podAnnotations }}
{{ toYaml .Values.podAnnotations }}
{{- end }}
{{- end }}

0 comments on commit ef7f9c4

Please sign in to comment.