From a619dfb5c6a8dabb0d523b2a298893cbfd19dd4a Mon Sep 17 00:00:00 2001 From: Matthew Fisher Date: Fri, 27 Apr 2018 15:58:00 -0700 Subject: [PATCH] set AutomountServiceAccountToken to nil by default --- cmd/helm/installer/install.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/helm/installer/install.go b/cmd/helm/installer/install.go index 0abd6774b..80af040fc 100644 --- a/cmd/helm/installer/install.go +++ b/cmd/helm/installer/install.go @@ -176,7 +176,6 @@ func generateDeployment(opts *Options) (*v1beta1.Deployment, error) { return nil, err } } - automountServiceAccountToken := opts.ServiceAccount != "" d := &v1beta1.Deployment{ ObjectMeta: metav1.ObjectMeta{ Namespace: opts.Namespace, @@ -190,8 +189,7 @@ func generateDeployment(opts *Options) (*v1beta1.Deployment, error) { Labels: labels, }, Spec: v1.PodSpec{ - ServiceAccountName: opts.ServiceAccount, - AutomountServiceAccountToken: &automountServiceAccountToken, + ServiceAccountName: opts.ServiceAccount, Containers: []v1.Container{ { Name: "tiller", @@ -234,6 +232,10 @@ func generateDeployment(opts *Options) (*v1beta1.Deployment, error) { }, } + if opts.ServiceAccount != "" { + d.Spec.Template.Spec.AutomountServiceAccountToken = func(b bool) *bool { return &b }(true) + } + if opts.tls() { const certsDir = "/etc/certs"