Skip to content

cli/prune: fix a case where parts where not detected as used from a recursive instance

Jérome Perrin requested to merge fix/prune_recursive_return into master

To consider if a shared part is used, we consider all files named slapos.cfg in the instance and try to parse them as a slapos config file. The problem was that as soon as a file can not be parsed as a slapos config file, we did not continue to evaluate other slapos.cfg files. It was a return where it should have been a continue.

This was especially incorrect, because when we have recursive slapos, we usually have a working copy of slapos repository, which contain stack/slapos.cfg, which is not a valid slapos config file.

As a result, when a top level shared part was used in a software installed in the recursive slapos from a theia or slaprunner instance, this shared part was not detected as used and could have been deleted.

The fix consist in checking all slapos.cfg files. This will make slapos node prune command probably much slower, because it will really iterate on all files now. Anyway this was fast because it was wrong.

Merge request reports