Skip to content

Commit 9055a17

Browse files
committed
add readOnlyRootFilesystem=true to operator deployments
1 parent 0878bc0 commit 9055a17

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# csi-snapshot-controller-operator
22

33
The CSI snapshot controller operator is an
4-
[OpenShift ClusterOperator](https://github.com/openshift/enhancements/blob/master/enhancements/dev-guide/operators.md#what-is-an-openshift-clusteroperator).
4+
[OpenShift ClusterOperator](https://github.com/openshift/enhancements/blob/master/dev-guide/operators.md#what-is-an-openshift-clusteroperator).
55
It installs and maintains the CSI Snapshot Controller, which is responsible for watching the VolumeSnapshot CRD objects and manages the creation and deletion lifecycle of volume snapshots.

manifests/07_deployment.yaml

+9-1
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,12 @@ spec:
3131
requests:
3232
memory: 65Mi
3333
cpu: 10m
34+
volumeMounts:
35+
- mountPath: /var/run/secrets/serving-cert
36+
name: serving-cert
3437
securityContext:
3538
allowPrivilegeEscalation: false
36-
readOnlyRootFilesystem: false
39+
readOnlyRootFilesystem: true
3740
capabilities:
3841
drop:
3942
- ALL
@@ -54,6 +57,11 @@ spec:
5457
fieldRef:
5558
fieldPath: metadata.name
5659
terminationMessagePolicy: FallbackToLogsOnError
60+
volumes:
61+
- name: serving-cert
62+
secret:
63+
secretName: serving-cert
64+
optional: true
5765
priorityClassName: "system-cluster-critical"
5866
nodeSelector:
5967
node-role.kubernetes.io/master: ""

profile-patches/hypershift/07_deployment.yaml-patch

+6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
- op: remove
2020
path: /spec/template/spec/priorityClassName
2121

22+
# Remove changes for readOnlyRootFilesystem
23+
- op: replace
24+
path: /spec/template/spec/containers/0/securityContext/readOnlyRootFilesystem
25+
value:
26+
false
27+
2228
# Add guest-kubeconfig volume
2329
- op: add
2430
path: /spec/template/spec/volumes

profile-patches/ibm-cloud-managed/07_deployment.yaml-patch

+12
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,15 @@
66
capability.openshift.io/name: CSISnapshot
77
- op: remove
88
path: /spec/template/spec/nodeSelector
9+
10+
# Remove serving-cert volume
11+
- op: remove
12+
path: /spec/template/spec/containers/0/volumeMounts
13+
- op: remove
14+
path: /spec/template/spec/volumes
15+
16+
# Remove changes for readOnlyRootFilesystem
17+
- op: replace
18+
path: /spec/template/spec/containers/0/securityContext/readOnlyRootFilesystem
19+
value:
20+
false

0 commit comments

Comments
 (0)