@@ -45,6 +45,37 @@ func TestEnsurePodSpec(t *testing.T) {
45
45
Containers : []corev1.Container {
46
46
{Name : "test" }}},
47
47
},
48
+ {
49
+ name : "AutomountServiceAccountToken none" ,
50
+ existing : corev1.PodSpec {
51
+ AutomountServiceAccountToken : boolPtr (false )},
52
+ input : corev1.PodSpec {},
53
+
54
+ expectedModified : true ,
55
+ expected : corev1.PodSpec {},
56
+ },
57
+ {
58
+ name : "AutomountServiceAccountToken changed" ,
59
+ existing : corev1.PodSpec {
60
+ AutomountServiceAccountToken : boolPtr (true )},
61
+ input : corev1.PodSpec {
62
+ AutomountServiceAccountToken : boolPtr (false )},
63
+
64
+ expectedModified : true ,
65
+ expected : corev1.PodSpec {
66
+ AutomountServiceAccountToken : boolPtr (false )},
67
+ },
68
+ {
69
+ name : "AutomountServiceAccountToken no changes" ,
70
+ existing : corev1.PodSpec {
71
+ AutomountServiceAccountToken : boolPtr (false )},
72
+ input : corev1.PodSpec {
73
+ AutomountServiceAccountToken : boolPtr (false )},
74
+
75
+ expectedModified : false ,
76
+ expected : corev1.PodSpec {
77
+ AutomountServiceAccountToken : boolPtr (false )},
78
+ },
48
79
{
49
80
name : "PodSecurityContext empty" ,
50
81
existing : corev1.PodSpec {
0 commit comments