Skip to content

Commit

Permalink
fix: Don't always return an error stating volumeMounts are colliding
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernauer committed Sep 27, 2024
1 parent 90d4cc0 commit c7c80f6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
7 changes: 7 additions & 0 deletions crates/stackable-operator/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ All notable changes to this project will be documented in this file.

### Fixed

- Fix always returning an error stating that volumeMounts are colliding. Instead move the error
creation to the correct location within an `if` statement

## [0.77.1] - 2024-09-26

### Fixed

- Fix the logback configuration for logback versions from 1.3.6/1.4.6 to 1.3.11/1.4.11 ([#874]).
- BREAKING: Avoid colliding volumes and mounts by only adding volumes or mounts if they do not already exist. This makes functions such as `PodBuilder::add_volume` or `ContainerBuilder::add_volume_mount` as well as related ones fallible ([#871]).

Expand Down
13 changes: 7 additions & 6 deletions crates/stackable-operator/src/builder/pod/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,14 @@ impl ContainerBuilder {
?existing_volume_mount,
"Colliding mountPath {colliding_mount_path:?} in volumeMounts with different content"
);

MountPathCollisionSnafu {
mount_path: &volume_mount.mount_path,
existing_volume_name: &existing_volume_mount.name,
new_volume_name: &volume_mount.name,
}
.fail()?;
}
MountPathCollisionSnafu {
mount_path: &volume_mount.mount_path,
existing_volume_name: &existing_volume_mount.name,
new_volume_name: &volume_mount.name,
}
.fail()?;
} else {
self.volume_mounts
.insert(volume_mount.mount_path.clone(), volume_mount);
Expand Down

0 comments on commit c7c80f6

Please sign in to comment.