File tree Expand file tree Collapse file tree 4 files changed +52
-0
lines changed
examples/chart/teleport-cluster Expand file tree Collapse file tree 4 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 1
1
{{- $auth := mustMergeOverwrite (mustDeepCopy .Values) .Values.auth -}}
2
+ {{- $projectedServiceAccountToken := semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version }}
2
3
{{- if $auth.serviceAccount.create -}}
3
4
apiVersion : v1
4
5
kind : ServiceAccount
@@ -19,4 +20,7 @@ metadata:
19
20
azure.workload.identity/client-id : " {{ $auth.azure.clientID }}"
20
21
{{- end }}
21
22
{{- end -}}
23
+ {{- if $projectedServiceAccountToken }}
24
+ automountServiceAccountToken : false
25
+ {{- end }}
22
26
{{- end }}
Original file line number Diff line number Diff line change 1
1
{{- $proxy := mustMergeOverwrite (mustDeepCopy .Values) .Values.proxy -}}
2
+ {{- $projectedServiceAccountToken := semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version }}
2
3
{{- if $proxy.serviceAccount.create -}}
3
4
apiVersion : v1
4
5
kind : ServiceAccount
@@ -13,4 +14,7 @@ metadata:
13
14
{{- if $proxy.annotations.serviceAccount }}
14
15
annotations : {{- toYaml $proxy.annotations.serviceAccount | nindent 4 }}
15
16
{{- end -}}
17
+ {{- if $projectedServiceAccountToken }}
18
+ automountServiceAccountToken : false
19
+ {{- end }}
16
20
{{- end }}
Original file line number Diff line number Diff line change @@ -50,3 +50,25 @@ tests:
50
50
- equal :
51
51
path : metadata.labels.baz
52
52
value : overridden
53
+
54
+ - it : does not set automountServiceAccountToken if cluster version is <1.20
55
+ set :
56
+ clusterName : helm-lint
57
+ capabilities :
58
+ majorVersion : 1
59
+ minorVersion : 18
60
+ asserts :
61
+ - notEqual :
62
+ path : automountServiceAccountToken
63
+ value : false
64
+
65
+ - it : sets automountServiceAccountToken to false if cluster version is >=1.20
66
+ set :
67
+ clusterName : helm-lint
68
+ capabilities :
69
+ majorVersion : 1
70
+ minorVersion : 20
71
+ asserts :
72
+ - equal :
73
+ path : automountServiceAccountToken
74
+ value : false
Original file line number Diff line number Diff line change @@ -40,3 +40,25 @@ tests:
40
40
- equal :
41
41
path : metadata.labels.baz
42
42
value : overridden
43
+
44
+ - it : does not set automountServiceAccountToken if cluster version is <1.20
45
+ set :
46
+ clusterName : helm-lint
47
+ capabilities :
48
+ majorVersion : 1
49
+ minorVersion : 18
50
+ asserts :
51
+ - notEqual :
52
+ path : automountServiceAccountToken
53
+ value : false
54
+
55
+ - it : sets automountServiceAccountToken to false if cluster version is >=1.20
56
+ set :
57
+ clusterName : helm-lint
58
+ capabilities :
59
+ majorVersion : 1
60
+ minorVersion : 20
61
+ asserts :
62
+ - equal :
63
+ path : automountServiceAccountToken
64
+ value : false
You can’t perform that action at this time.
0 commit comments