Merge pull request #24 from gimlet-io/gimlet-taxonomy
Set Gimlet service taxonomy if git data is set
This commit is contained in:
@@ -5,6 +5,10 @@ metadata:
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "helm-chart.labels" . | nindent 4 }}
|
||||
{{- if .Values.gitSha }}
|
||||
annotations:
|
||||
gimlet.io/git-sha: {{ .Values.gitSha }}
|
||||
{{- end }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicas }}
|
||||
selector:
|
||||
@@ -22,6 +26,12 @@ spec:
|
||||
{{- with .Values.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.gitSha }}
|
||||
gimlet.io/git-sha: {{ .Values.gitSha }}
|
||||
{{- end }}
|
||||
{{- if .Values.gitRepository }}
|
||||
gimlet.io/git-repository: {{ .Values.gitRepository }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "helm-chart.selectorLabels" . | nindent 8 }}
|
||||
spec:
|
||||
|
||||
@@ -13,9 +13,17 @@ metadata:
|
||||
namespace: {{ .root.Release.Namespace }}
|
||||
labels:
|
||||
{{- include "helm-chart.labels" .root | nindent 4 }}
|
||||
{{- with .ingress.annotations }}
|
||||
{{- if or (or .root.Values.gitSha .ingress.annotations) .root.Values.gitRepository }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- if .ingress.annotations }}
|
||||
{{- toYaml .ingress.annotations | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .root.Values.gitSha }}
|
||||
gimlet.io/git-sha: {{ .root.Values.gitSha }}
|
||||
{{- end }}
|
||||
{{- if .root.Values.gitRepository }}
|
||||
gimlet.io/git-sha: {{ .root.Values.gitRepository }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if default false .ingress.tlsEnabled }}
|
||||
|
||||
@@ -5,6 +5,15 @@ metadata:
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "helm-chart.labels" . | nindent 4 }}
|
||||
{{- if or .Values.gitRepository .Values.gitSha }}
|
||||
annotations:
|
||||
{{- if .Values.gitRepository }}
|
||||
gimlet.io/git-repository: {{ .Values.gitRepository }}
|
||||
{{- end }}
|
||||
{{- if .Values.gitSha }}
|
||||
gimlet.io/git-sha: {{ .Values.gitSha }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ if .Values.nodePortEnabled }}NodePort{{ else if .Values.loadbalancerEnabled }}LoadBalancer{{ else }}ClusterIP{{ end }}
|
||||
{{- if .Values.stickySessions }}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
suite: test service
|
||||
templates:
|
||||
- service.yaml
|
||||
tests:
|
||||
- it: Should set Gimlet taxonomy
|
||||
set:
|
||||
gitRepository: github.com/laszlocph/demo-app
|
||||
gitSha: xyz
|
||||
asserts:
|
||||
- equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
gimlet.io/git-repository: github.com/laszlocph/demo-app
|
||||
gimlet.io/git-sha: xyz
|
||||
Reference in New Issue
Block a user