Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
labels:
k8s-app: cluster-version-operator
spec:
automountServiceAccountToken: false
automountServiceAccountToken: false # removed in the next version.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kube-api-access mount point should also be removed in the next version

containers:
- name: cluster-version-operator
image: '{{.ReleaseImage}}'
Expand Down
1 change: 1 addition & 0 deletions lib/resourcemerge/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func ensurePodSpec(modified *bool, existing *corev1.PodSpec, required corev1.Pod
}
}

setBoolPtr(modified, &existing.AutomountServiceAccountToken, required.AutomountServiceAccountToken)
setStringIfSet(modified, &existing.ServiceAccountName, required.ServiceAccountName)
setBool(modified, &existing.HostNetwork, required.HostNetwork)
mergeMap(modified, &existing.NodeSelector, required.NodeSelector)
Expand Down
31 changes: 31 additions & 0 deletions lib/resourcemerge/core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,37 @@ func TestEnsurePodSpec(t *testing.T) {
Containers: []corev1.Container{
{Name: "test"}}},
},
{
name: "AutomountServiceAccountToken none",
existing: corev1.PodSpec{
AutomountServiceAccountToken: boolPtr(false)},
input: corev1.PodSpec{},

expectedModified: true,
expected: corev1.PodSpec{},
},
{
name: "AutomountServiceAccountToken changed",
existing: corev1.PodSpec{
AutomountServiceAccountToken: boolPtr(true)},
input: corev1.PodSpec{
AutomountServiceAccountToken: boolPtr(false)},

expectedModified: true,
expected: corev1.PodSpec{
AutomountServiceAccountToken: boolPtr(false)},
},
{
name: "AutomountServiceAccountToken no changes",
existing: corev1.PodSpec{
AutomountServiceAccountToken: boolPtr(false)},
input: corev1.PodSpec{
AutomountServiceAccountToken: boolPtr(false)},

expectedModified: false,
expected: corev1.PodSpec{
AutomountServiceAccountToken: boolPtr(false)},
},
{
name: "PodSecurityContext empty",
existing: corev1.PodSpec{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
labels:
k8s-app: cluster-version-operator
spec:
automountServiceAccountToken: false
automountServiceAccountToken: false # removed in the next version.
containers:
- name: cluster-version-operator
image: 'quay.io/cvo/release:latest'
Expand Down