File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
crates/lib/src/bootc_composefs Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -123,13 +123,16 @@ pub(crate) fn write_composefs_state(
123123
124124 let actual_var_path = root_path. join ( SHARED_VAR_PATH ) ;
125125 create_dir_all ( & actual_var_path) ?;
126-
127- symlink (
128- path_relative_to ( state_path. as_std_path ( ) , actual_var_path. as_std_path ( ) )
129- . context ( "Getting var symlink path" ) ?,
130- state_path. join ( "var" ) ,
131- )
132- . context ( "Failed to create symlink for /var" ) ?;
126+
127+ let var_symlink_target = path_relative_to ( state_path. as_std_path ( ) , actual_var_path. as_std_path ( ) )
128+ . context ( "Getting var symlink path" ) ?;
129+
130+ let var_symlink_path = state_path. join ( "var" ) ;
131+
132+ if !var_symlink_path. exists ( ) {
133+ symlink ( & var_symlink_target, & var_symlink_path)
134+ . context ( "Failed to create symlink for /var" ) ?;
135+ }
133136
134137 let ImageReference {
135138 image : image_name,
You can’t perform that action at this time.
0 commit comments