@@ -109,13 +109,17 @@ func TestBuildStatefulSet_VolumesAndMounts(t *testing.T) {
109109 sts := BuildStatefulSet (minimalInstance (), nil )
110110 c := sts .Spec .Template .Spec .Containers [0 ]
111111
112- mountNames := map [string ]string {}
112+ mountsByName := map [string ]corev1. VolumeMount {}
113113 for _ , m := range c .VolumeMounts {
114- mountNames [m .Name ] = m .MountPath
115- }
116- assert .Equal (t , "/opt/data" , mountNames ["data" ], "PVC mounted at HERMES_HOME (/opt/data)" )
117- assert .Equal (t , "/opt/data/config.yaml" , mountNames ["config" ], "configmap subPath at config.yaml" )
118- assert .Equal (t , "/tmp" , mountNames ["tmp" ], "writable /tmp" )
114+ mountsByName [m .Name ] = m
115+ assert .NotEqual (t , "/opt/data/config.yaml" , m .MountPath ,
116+ "runtime config must remain writable on the data PVC" )
117+ }
118+ assert .Equal (t , "/opt/data" , mountsByName ["data" ].MountPath , "PVC mounted at HERMES_HOME (/opt/data)" )
119+ assert .Equal (t , "/etc/hermes/config.yaml" , mountsByName ["config" ].MountPath ,
120+ "operator config is mounted as Hermes managed scope" )
121+ assert .True (t , mountsByName ["config" ].ReadOnly , "managed config must be immutable" )
122+ assert .Equal (t , "/tmp" , mountsByName ["tmp" ].MountPath , "writable /tmp" )
119123}
120124
121125func minimalInstance () * hermesv1.HermesInstance {
0 commit comments