Open MarthaScheffler opened 2 months ago
Thanks Martha for opening issue !
Adding complement of the current behavior: the flow shared by Martha above will actually delete all files, but the underlying folder structure created stay in place (they are empty) Goal: also remove folders when no specific files are targeted.
For example
- id: delete_namespace_files
type: io.kestra.plugin.core.namespace.DeleteFiles
namespace: "{{ flow.namespace }}"
files:
- "my_folder/**"
Should remove all files from my_folder
and the folder itself.
Maybe we want to add a flag deleteFolder: true | false
to keep things explicit and not mix with glob semantic
Hey @Ben8t @MilosPaunovic Can I pick this up if this is still open?
Absolutely @Malaydewangan09! :rocket:
Thanks @MilosPaunovic Let me summarize this once If we add a flag as suggested by @Ben8t (false by default), When the flag is set to 'true,' the folder should also be deleted if it becomes empty after its all files are removed.
@Malaydewangan09 Hello! You get the issue!
@Ben8t I suggest we call it deleteParentFolder
to avoid confusion thinking you need to enable it to delete folder in the given glob pattern
Feature description
enhance the DeleteFiles plugin (https://kestra.io/plugins/core/tasks/namespace/io.kestra.plugin.core.namespace.deletefiles) to also remove folders.
example flow: