diff --git a/crates/stackable-operator/src/builder/pod/container.rs b/crates/stackable-operator/src/builder/pod/container.rs index 73bc0916e..2d648a3e6 100644 --- a/crates/stackable-operator/src/builder/pod/container.rs +++ b/crates/stackable-operator/src/builder/pod/container.rs @@ -28,11 +28,22 @@ pub enum Error { #[snafu(display( "The volumeMount is clashing with an already existing volumeMount with the same mountPath but a different content. \ - The existing volumeMount is {existing_volume_mount:?}, the new one is {new_volume_mount:?}" + The shared mountPath is {mount_path:?}, \ + the existing mount's volume name is {existing_volume_name:?}, \ + the existing mount's subPath is {existing_sub_path:?}, \ + the existing mount's SubPathExpr is {existing_sub_path_expr:?}, \ + the new mount's volume name is {new_volume_name:?}, \ + the new mount's subPath is {new_sub_path:?}, \ + the new mount's SubPathExpr is {new_sub_path_expr:?}" ))] - ClashingVolumeMountMountPath { - existing_volume_mount: Box, - new_volume_mount: Box, + ClashingMountPath { + mount_path: String, + existing_volume_name: String, + existing_sub_path: Option, + existing_sub_path_expr: Option, + new_volume_name: String, + new_sub_path: Option, + new_sub_path_expr: Option, }, } @@ -219,9 +230,14 @@ impl ContainerBuilder { if let Some(existing_volume_mount) = self.volume_mounts.get(&volume_mount.mount_path) { ensure!( existing_volume_mount == &volume_mount, - ClashingVolumeMountMountPathSnafu { - existing_volume_mount: existing_volume_mount.clone(), - new_volume_mount: volume_mount, + ClashingMountPathSnafu { + mount_path: volume_mount.mount_path, + existing_volume_name: existing_volume_mount.name.clone(), + existing_sub_path: existing_volume_mount.sub_path.clone(), + existing_sub_path_expr: existing_volume_mount.sub_path_expr.clone(), + new_volume_name: volume_mount.name, + new_sub_path: volume_mount.sub_path, + new_sub_path_expr: volume_mount.sub_path_expr, } ); } else {