Skip to content

Commit f9c13fd

Browse files
pengzhoumlPeng Zhou
andauthored
MLE-16081: Fix Nil Pointer Issue in getVolumeMount (#21)
Co-authored-by: Peng Zhou <[email protected]>
1 parent d0fb9fa commit f9c13fd

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

charts/marklogic-operator/templates/marklogiccluster-crd.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1206,6 +1206,17 @@ spec:
12061206
name:
12071207
type: string
12081208
type: object
1209+
hugePages:
1210+
default:
1211+
enabled: false
1212+
mountPath: /dev/hugepages
1213+
properties:
1214+
enabled:
1215+
type: boolean
1216+
mountPath:
1217+
default: /dev/hugepages
1218+
type: string
1219+
type: object
12091220
image:
12101221
default: progressofficial/marklogic-db:11.3.0-ubi-rootless
12111222
type: string
@@ -2084,6 +2095,8 @@ spec:
20842095
type: object
20852096
type: object
20862097
storage:
2098+
description: Storage is the inteface to add pvc and pv support
2099+
in marklogic
20872100
properties:
20882101
size:
20892102
type: string

charts/marklogic-operator/templates/marklogicgroup-crd.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,17 @@ spec:
11811181
name:
11821182
type: string
11831183
type: object
1184+
hugePages:
1185+
default:
1186+
enabled: false
1187+
mountPath: /dev/hugepages
1188+
properties:
1189+
enabled:
1190+
type: boolean
1191+
mountPath:
1192+
default: /dev/hugepages
1193+
type: string
1194+
type: object
11841195
image:
11851196
default: progressofficial/marklogic-db:11.3.0-ubi-rootless
11861197
type: string
@@ -2052,6 +2063,7 @@ spec:
20522063
type: object
20532064
type: object
20542065
storage:
2066+
description: Storage is the inteface to add pvc and pv support in marklogic
20552067
properties:
20562068
size:
20572069
type: string

pkg/k8sutil/statefulset.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ func generateVolumes(stsName string, containerParams containerParameters) []core
340340
},
341341
},
342342
})
343-
if containerParams.HugePages.Enabled {
343+
if containerParams.HugePages != nil && containerParams.HugePages.Enabled {
344344
volumes = append(volumes, corev1.Volume{
345345
Name: "huge-pages",
346346
VolumeSource: corev1.VolumeSource{
@@ -442,7 +442,7 @@ func getVolumeMount(containerParams containerParameters) []corev1.VolumeMount {
442442
ReadOnly: true,
443443
},
444444
)
445-
if containerParams.HugePages.Enabled {
445+
if containerParams.HugePages != nil && containerParams.HugePages.Enabled {
446446
VolumeMounts = append(VolumeMounts,
447447
corev1.VolumeMount{
448448
Name: "huge-pages",

0 commit comments

Comments
 (0)