Skip to content

Commit f689e62

Browse files
committed
Cache DENY_RW to ALLOW_RW if owners=1 #397
1 parent f3ebb44 commit f689e62

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

pkg/controller/infinispan/infinispan_controller.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,17 @@ func (r *ReconcileInfinispan) deploymentForInfinispan(m *infinispanv1.Infinispan
12731273
dep.Spec.Template.Spec.InitContainers = []corev1.Container{{
12741274
Image: "busybox",
12751275
Name: "chmod-pv",
1276-
Command: []string{"sh", "-c", "chmod -R g+w /opt/infinispan/server/data"},
1276+
Command: []string{"sh", "-c", `chmod -R g+w /opt/infinispan/server/data;cd /opt/infinispan/server/data; sed -i '/distributed-cache owners="1"/,/distributed-cache/ s/DENY/ALLOW/' caches.xml || true`},
1277+
VolumeMounts: []corev1.VolumeMount{{
1278+
Name: m.ObjectMeta.Name,
1279+
MountPath: "/opt/infinispan/server/data",
1280+
}},
1281+
}}
1282+
} else {
1283+
dep.Spec.Template.Spec.InitContainers = []corev1.Container{{
1284+
Image: "busybox",
1285+
Name: "chmod-pv",
1286+
Command: []string{"sh", "-c", `cd /opt/infinispan/server/data; sed -i '/distributed-cache owners="1"/,/distributed-cache/ s/DENY/ALLOW/' caches.xml || true`},
12771287
VolumeMounts: []corev1.VolumeMount{{
12781288
Name: m.ObjectMeta.Name,
12791289
MountPath: "/opt/infinispan/server/data",

0 commit comments

Comments
 (0)