From 45336743574b901cc8eebe2d21abcaaaa3874cf0 Mon Sep 17 00:00:00 2001 From: Tuan Anh Nguyen <48820639+tuananhnguyen-ct@users.noreply.github.com> Date: Thu, 14 May 2020 03:12:28 +0700 Subject: [PATCH] [stable/aws-iam-authenticator] Add apps/v1 support (#22326) * add apps/v1 support Signed-off-by: Tuan Anh Nguyen * add label selector Signed-off-by: Tuan Anh Nguyen --- stable/aws-iam-authenticator/Chart.yaml | 2 +- stable/aws-iam-authenticator/templates/_helpers.tpl | 11 +++++++++++ stable/aws-iam-authenticator/templates/daemonset.yaml | 6 +++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/stable/aws-iam-authenticator/Chart.yaml b/stable/aws-iam-authenticator/Chart.yaml index f9bb76bae0..9025a580f3 100644 --- a/stable/aws-iam-authenticator/Chart.yaml +++ b/stable/aws-iam-authenticator/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.0" description: A Helm chart for aws-iam-authenticator name: aws-iam-authenticator -version: 0.1.2 +version: 0.1.3 home: https://github.com/kubernetes-sigs/aws-iam-authenticator maintainers: - name: plumdog diff --git a/stable/aws-iam-authenticator/templates/_helpers.tpl b/stable/aws-iam-authenticator/templates/_helpers.tpl index cc1a336c77..8893114dba 100644 --- a/stable/aws-iam-authenticator/templates/_helpers.tpl +++ b/stable/aws-iam-authenticator/templates/_helpers.tpl @@ -30,3 +30,14 @@ Create chart name and version as used by the chart label. {{- define "aws-iam-authenticator.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} + +{{/* +Return the apiVersion of daemonset. +*/}} +{{- define "daemonset.apiVersion" -}} +{{- if .Capabilities.APIVersions.Has "apps/v1" -}} + {{- print "apps/v1" -}} +{{- else -}} + {{- print "extensions/v1beta1" -}} +{{- end -}} +{{- end -}} diff --git a/stable/aws-iam-authenticator/templates/daemonset.yaml b/stable/aws-iam-authenticator/templates/daemonset.yaml index 66aa35d885..98fbcd36b8 100644 --- a/stable/aws-iam-authenticator/templates/daemonset.yaml +++ b/stable/aws-iam-authenticator/templates/daemonset.yaml @@ -1,4 +1,4 @@ -apiVersion: extensions/v1beta1 +apiVersion: {{ template "daemonset.apiVersion" . }} kind: DaemonSet metadata: name: {{ template "aws-iam-authenticator.fullname" . }} @@ -8,6 +8,10 @@ metadata: release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: + selector: + matchLabels: + app: {{ template "aws-iam-authenticator.name" . }} + release: {{ .Release.Name }} updateStrategy: type: RollingUpdate template: