Skip to content
This repository has been archived by the owner on Jan 19, 2024. It is now read-only.

Commit

Permalink
fix(installer): Revert immutable k8s labels (#8213)
Browse files Browse the repository at this point in the history
Co-authored-by: RealAnna <[email protected]>
  • Loading branch information
mowies and RealAnna authored Jun 29, 2022
1 parent 0e16953 commit efbaa15
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ vendor/*

#binary - go build
helm-service

chart/charts/*.tgz
chart/Chart.lock
6 changes: 3 additions & 3 deletions chart/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Expand the name of the chart.
*/}}
{{- define "helm-service.name" -}}
{{- include "common.names.name" . -}}
{{- include "keptn.common.names.name" . -}}
{{- end }}

{{/*
Expand All @@ -11,14 +11,14 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
If release name contains chart name it will be used as a full name.
*/}}
{{- define "helm-service.fullname" -}}
{{- include "common.names.fullname" . -}}
{{- include "keptn.common.names.fullname" . -}}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "helm-service.chart" -}}
{{- include "common.names.chart" . -}}
{{- include "keptn.common.names.chart" . -}}
{{- end }}

{{/*
Expand Down
16 changes: 6 additions & 10 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "helm-service.fullname" . }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: helm-service
labels: {{- include "keptn.common.labels.standard" . | nindent 4 }}
app.kubernetes.io/name: helm-service
spec:
replicas: 1
selector:
matchLabels: {{- include "common.labels.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: helm-service
matchLabels: {{- include "keptn.common.labels.selectorLabels" . | nindent 6 }}
app.kubernetes.io/name: helm-service
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels: {{- include "common.labels.standard" . | nindent 8 }}
app.kubernetes.io/component: helm-service
labels: {{- include "keptn.common.labels.standard" . | nindent 8 }}
app.kubernetes.io/name: helm-service
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down Expand Up @@ -137,10 +137,6 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.labels['app.kubernetes.io/name']
- name: K8S_DEPLOYMENT_COMPONENT
valueFrom:
fieldRef:
fieldPath: metadata.labels['app.kubernetes.io/component']
- name: K8S_POD_NAME
valueFrom:
fieldRef:
Expand Down
8 changes: 4 additions & 4 deletions chart/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ apiVersion: v1
kind: Service
metadata:
name: {{ include "helm-service.fullname" . }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: helm-service
labels: {{- include "keptn.common.labels.standard" . | nindent 4 }}
app.kubernetes.io/name: helm-service
spec:
type: ClusterIP
ports:
- port: 8080
protocol: TCP
selector: {{- include "common.labels.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: helm-service
selector: {{- include "keptn.common.labels.selectorLabels" . | nindent 4 }}
app.kubernetes.io/name: helm-service
{{- end }}
8 changes: 4 additions & 4 deletions chart/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "helm-service.serviceAccountName" . }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: helm-service
labels: {{- include "keptn.common.labels.standard" . | nindent 4 }}
app.kubernetes.io/name: helm-service
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand All @@ -14,8 +14,8 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: keptn-{{ .Release.Namespace }}-helm-service-cluster-admin
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: helm-service
labels: {{- include "keptn.common.labels.standard" . | nindent 4 }}
app.kubernetes.io/name: helm-service
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
Expand Down
4 changes: 2 additions & 2 deletions chart/templates/tests/test-api-connection.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ apiVersion: v1
kind: Pod
metadata:
name: "{{ include "helm-service.fullname" . }}-test-api-connection"
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: helm-service
labels: {{- include "keptn.common.labels.standard" . | nindent 4 }}
app.kubernetes.io/name: helm-service
annotations:
"helm.sh/hook": test
spec:
Expand Down

0 comments on commit efbaa15

Please sign in to comment.