File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
engine/internal/provision/thinclones/zfs Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -172,12 +172,11 @@ func (m *Manager) Pool() *resources.Pool {
172172func (m * Manager ) CreateClone (cloneName , snapshotID string ) error {
173173 exists , err := m .cloneExists (cloneName )
174174 if err != nil {
175- return errors . Wrap ( err , "clone does not exist" )
175+ return fmt . Errorf ( "cannot check the clone existence: %w" , err )
176176 }
177177
178178 if exists {
179- log .Msg (fmt .Sprintf ("clone %q is already exists. Skip creation" , cloneName ))
180- return nil
179+ return fmt .Errorf ("clone %q is already exists. Skip creation" , cloneName )
181180 }
182181
183182 clonesMountDir := m .config .Pool .ClonesDir ()
@@ -225,7 +224,7 @@ func (m *Manager) DestroyClone(cloneName string) error {
225224
226225// cloneExists checks whether a ZFS clone exists.
227226func (m * Manager ) cloneExists (name string ) (bool , error ) {
228- listZfsClonesCmd := "zfs list"
227+ listZfsClonesCmd := "zfs list -r " + m . config . Pool . Name
229228
230229 out , err := m .runner .Run (listZfsClonesCmd , false )
231230 if err != nil {
You can’t perform that action at this time.
0 commit comments