Skip to content

Commit c94b9c7

Browse files
Update crates/lib/src/bootc_composefs/state.rs
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Kyle Gospodnetich <[email protected]>
1 parent 581488c commit c94b9c7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

crates/lib/src/bootc_composefs/state.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,10 @@ pub(crate) fn write_composefs_state(
129129

130130
let var_symlink_path = state_path.join("var");
131131

132-
if !var_symlink_path.exists() {
133-
symlink(&var_symlink_target, &var_symlink_path)
134-
.context("Failed to create symlink for /var")?;
132+
match symlink(&var_symlink_target, &var_symlink_path) {
133+
Ok(_) => (),
134+
Err(e) if e.kind() == std::io::ErrorKind::AlreadyExists => (),
135+
Err(e) => return Err(anyhow::Error::new(e).context("Failed to create symlink for /var")),
135136
}
136137

137138
let ImageReference {

0 commit comments

Comments
 (0)