From e06cbe12168b3621147f446fcdeaada17bac0a46 Mon Sep 17 00:00:00 2001 From: Waqar Ahmed Date: Sat, 30 Jan 2021 00:12:32 +0500 Subject: [PATCH] Update minio service/serviceaccount implementations to use library chart --- test/minio/1.0.1/templates/service.yaml | 27 +++++-------------- .../minio/1.0.1/templates/serviceaccount.yaml | 10 +------ 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a/test/minio/1.0.1/templates/service.yaml b/test/minio/1.0.1/templates/service.yaml index 3f0c68b930..a02cbfb06a 100644 --- a/test/minio/1.0.1/templates/service.yaml +++ b/test/minio/1.0.1/templates/service.yaml @@ -1,21 +1,6 @@ -{{ $scheme := "http" }} -apiVersion: v1 -kind: Service -metadata: - name: {{ template "minio.fullname" . }} - labels: - app: {{ template "minio.name" . }} - chart: {{ template "minio.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - type: "NodePort" - ports: - - name: {{ $scheme }} - port: {{ .Values.service.nodePort }} - protocol: TCP - nodePort: {{ .Values.service.nodePort }} - targetPort: 9000 - selector: - app: {{ template "minio.name" . }} - release: {{ .Release.Name }} +{{ $svc := .Values.service }} +{{ $ports := list }} +{{ $ports = mustAppend $ports (dict "name" "http" "port" $svc.nodePort "nodePort" $svc.nodePort "targetPort" 9000) }} +{{ $params := . }} +{{ $_ := set $params "service" (dict "type" "NodePort" "ports" $ports ) }} +{{ include "common.classes.service" $params }} diff --git a/test/minio/1.0.1/templates/serviceaccount.yaml b/test/minio/1.0.1/templates/serviceaccount.yaml index 2db987867a..811923611e 100644 --- a/test/minio/1.0.1/templates/serviceaccount.yaml +++ b/test/minio/1.0.1/templates/serviceaccount.yaml @@ -1,9 +1 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "minio.serviceAccountName" . | quote }} - namespace: {{ .Release.Namespace | quote }} - labels: - app: {{ template "minio.name" . }} - chart: {{ template "minio.chart" . }} - release: "{{ .Release.Name }}" +{{- include "common.serviceaccount" . -}}