Skip to content

Commit b778a07

Browse files
authored
test: make sure minio-client config directory is writable (cloudnative-pg#2076)
Closes cloudnative-pg#2075 Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
1 parent 8e7cf98 commit b778a07

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

tests/utils/minio.go

+19-5
Original file line numberDiff line numberDiff line change
@@ -398,14 +398,22 @@ func MinioDefaultClient(namespace string) corev1.Pod {
398398
// MinioSSLClient returns the Pod definition for a minio client using SSL
399399
func MinioSSLClient(namespace string) corev1.Pod {
400400
const (
401-
minioServerCASecret = "minio-server-ca-secret" // #nosec
402-
tlsVolumeName = "secret-volume"
403-
tlsVolumeMountPath = "/mc/.mc/certs/CAs"
401+
configVolumeMountPath = "/mc/.mc"
402+
configVolumeName = "mc-config"
403+
minioServerCASecret = "minio-server-ca-secret" // #nosec
404+
tlsVolumeName = "secret-volume"
405+
tlsVolumeMountPath = configVolumeMountPath + "/certs/CAs"
404406
)
405407
var secretMode int32 = 0o600
406408

407409
minioClient := MinioDefaultClient(namespace)
408410
minioClient.Spec.Volumes = append(minioClient.Spec.Volumes,
411+
corev1.Volume{
412+
Name: configVolumeName,
413+
VolumeSource: corev1.VolumeSource{
414+
EmptyDir: &corev1.EmptyDirVolumeSource{},
415+
},
416+
},
409417
corev1.Volume{
410418
Name: tlsVolumeName,
411419
VolumeSource: corev1.VolumeSource{
@@ -414,13 +422,19 @@ func MinioSSLClient(namespace string) corev1.Pod {
414422
DefaultMode: &secretMode,
415423
},
416424
},
417-
})
425+
},
426+
)
418427
minioClient.Spec.Containers[0].VolumeMounts = append(
419428
minioClient.Spec.Containers[0].VolumeMounts,
429+
corev1.VolumeMount{
430+
Name: configVolumeName,
431+
MountPath: configVolumeMountPath,
432+
},
420433
corev1.VolumeMount{
421434
Name: tlsVolumeName,
422435
MountPath: tlsVolumeMountPath,
423-
})
436+
},
437+
)
424438
minioClient.Spec.Containers[0].Env[0].Value = "https://minio:minio123@minio-service:9000"
425439

426440
return minioClient

0 commit comments

Comments
 (0)