Skip to content

Commit 39b3e84

Browse files
committed
refactoring
1 parent c7c80f6 commit 39b3e84

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

crates/stackable-operator/src/builder/pod/container.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ pub enum Error {
2828
},
2929

3030
#[snafu(display(
31-
"Colliding mountPath {mount_path:?} in volumeMounts with different content. \
31+
"Colliding mountPath {colliding_mount_path:?} in volumeMounts with different content. \
3232
Existing volume name {existing_volume_name:?}, new volume name {new_volume_name:?}"
3333
))]
3434
MountPathCollision {
35-
mount_path: String,
35+
colliding_mount_path: String,
3636
existing_volume_name: String,
3737
new_volume_name: String,
3838
},
@@ -234,7 +234,7 @@ impl ContainerBuilder {
234234
);
235235

236236
MountPathCollisionSnafu {
237-
mount_path: &volume_mount.mount_path,
237+
colliding_mount_path,
238238
existing_volume_name: &existing_volume_mount.name,
239239
new_volume_name: &volume_mount.name,
240240
}

crates/stackable-operator/src/builder/pod/mod.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ pub enum Error {
5252
#[snafu(display("object is missing key {key:?}"))]
5353
MissingObjectKey { key: &'static str },
5454

55-
#[snafu(display("Colliding volume name {volume_name:?} in volumes with different content"))]
56-
VolumeNameCollision { volume_name: String },
55+
#[snafu(display(
56+
"Colliding volume name {colliding_volume_name:?} in volumes with different content"
57+
))]
58+
VolumeNameCollision { colliding_volume_name: String },
5759
}
5860

5961
/// A builder to build [`Pod`] or [`PodTemplateSpec`] objects.
@@ -292,16 +294,16 @@ impl PodBuilder {
292294
pub fn add_volume(&mut self, volume: Volume) -> Result<&mut Self> {
293295
if let Some(existing_volume) = self.volumes.get(&volume.name) {
294296
if existing_volume != &volume {
295-
let colliding_name = &volume.name;
297+
let colliding_volume_name = &volume.name;
296298
// We don't want to include the details in the error message, but instead trace them
297299
tracing::error!(
298-
colliding_name,
300+
colliding_volume_name,
299301
?existing_volume,
300-
"Colliding volume name {colliding_name:?} in volumes with different content"
302+
"Colliding volume name {colliding_volume_name:?} in volumes with different content"
301303
);
302304

303305
VolumeNameCollisionSnafu {
304-
volume_name: &volume.name,
306+
colliding_volume_name,
305307
}
306308
.fail()?;
307309
}

0 commit comments

Comments
 (0)