Make sure the backup object store is empty when bootstrapping a new cluster
When bootstrapping a new cluster from a recovery object store, and the target cluster has a backup object store configured, invoke barman-cloud-check-wal-archive to make sure that the destination backup object store is empty.
This prevents users from erroneously overwrite an existing object store. The same concept can be probably extended to any bootstrap phase.
@gbartolini I found an issue, we can't check the "future" object store from the operator since we don't have the barman-cloud-check-wal-archive command, this can only run inside a cluster already created, meaning that we can check during the init job only, and that will create at least one pod, it's that solution ok with you? It's the only solution I can see by now since only those container will have the Barman tools we need.
@gbartolini After talking with @mnencia I have a cleared idea and I'll be moving this soon
I believe https://github.com/cloudnative-pg/cloudnative-pg/issues/62#issuecomment-1113878444 applies to this issue as well?
Taking the issue back - I think I can add a quick E2E
I have added an issue to add E2E tests for the new backup + restore scenarios. For the moment this PR could be tested manually. Moving to second review.