Skip to content

Commit

Permalink
readOnly for ConfigMaps (#48)
Browse files Browse the repository at this point in the history
* readOnly for ConfigMaps

* add Readonly in handler

* remove readOnly from types

* fix unit test
  • Loading branch information
AdheipSingh authored Jul 29, 2020
1 parent 0372b5d commit 925aaa3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions pkg/controller/druid/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -578,10 +578,12 @@ func makeStatefulSet(nodeSpec *v1alpha1.DruidNodeSpec, m *v1alpha1.Druid, ls map
{
MountPath: firstNonEmptyStr(m.Spec.CommonConfigMountPath, defaultCommonConfigMountPath),
Name: "common-config-volume",
ReadOnly: true,
},
{
MountPath: firstNonEmptyStr(nodeSpec.NodeConfigMountPath, defaultNodeConfigMountPath),
Name: "nodetype-config-volume",
ReadOnly: true,
},
}

Expand Down
5 changes: 4 additions & 1 deletion pkg/controller/druid/testdata/broker-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
name: druid-druid-test-brokers
namespace: test-namespace
annotations:
druidOpResourceHash: JvDKxq3cBaf0FBXMscfcQ/RXrcs=
druidOpResourceHash: OnEopGbFnwSCMqd84ePrk0Kvd9o=
spec:
podManagementPolicy: Parallel
replicas: 2
Expand Down Expand Up @@ -59,10 +59,13 @@ spec:
memory: 2Gi
volumeMounts:
- mountPath: /druid/conf/druid/_common
readOnly: true
name: common-config-volume
- mountPath: /druid/conf/druid/broker
readOnly: true
name: nodetype-config-volume
- mountPath: /druid/data
readOnly: true
name: data-volume
securityContext:
fsGroup: 107
Expand Down
1 change: 1 addition & 0 deletions pkg/controller/druid/testdata/druid-test-cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ spec:
volumeMounts:
- mountPath: /druid/data
name: data-volume
readOnly: true
resources:
requests:
memory: "2Gi"
Expand Down

0 comments on commit 925aaa3

Please sign in to comment.