Skip to content

Commit 6c94535

Browse files
committed
OTA-1480: Add readonlyRootFilesystem
1 parent 2d837d9 commit 6c94535

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

bootstrap/bootstrap-pod.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ spec:
1919
- "--kubeconfig=/etc/kubernetes/kubeconfig"
2020
securityContext:
2121
privileged: true
22+
readOnlyRootFilesystem: true
2223
terminationMessagePolicy: FallbackToLogsOnError
2324
volumeMounts:
2425
- mountPath: /etc/ssl/certs

install/0000_00_cluster-version-operator_03_deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ spec:
4444
cpu: 20m
4545
memory: 50Mi
4646
terminationMessagePolicy: FallbackToLogsOnError
47+
securityContext:
48+
readOnlyRootFilesystem: true
4749
volumeMounts:
4850
- mountPath: /etc/ssl/certs
4951
name: etc-ssl-certs

pkg/cvo/updatepayload.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ func (r *payloadRetriever) fetchUpdatePayloadToDir(ctx context.Context, dir stri
264264
setContainerDefaults(corev1.Container{
265265
Name: "rename-to-final-location",
266266
Command: []string{"mv", tmpDir, dir},
267+
SecurityContext: &corev1.SecurityContext{
268+
ReadOnlyRootFilesystem: ptr.To(true),
269+
},
267270
}),
268271
},
269272
Volumes: []corev1.Volume{{

pkg/payload/testdata/TestRenderManifest_expected_cvo_deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ spec:
4444
cpu: 20m
4545
memory: 50Mi
4646
terminationMessagePolicy: FallbackToLogsOnError
47+
securityContext:
48+
readOnlyRootFilesystem: true
4749
volumeMounts:
4850
- mountPath: /etc/ssl/certs
4951
name: etc-ssl-certs

0 commit comments

Comments
 (0)