terraform-provider-flux
terraform-provider-flux copied to clipboard
Fix bootstrap running when git history is empty
The issue does not come from any code in the provider, but from an incompatibility with the current bootstrap code. It does not expect an empty cloned repository when running and will fail. This is not an issue in the CLI bootstrap command because it does not clone the repository before the bootstrap function is run.
https://github.com/fluxcd/flux2/blob/2e4de673b229b3da1ef4aa613080bd05668d9f6e/pkg/bootstrap/bootstrap_plain_git.go#L112-L116
Fixes #365
So there seems to be an error when committing file deletion which causes the repository to become empty.
https://github.com/fluxcd/go-git/blob/2e5c9d01cfc45de34975e567cf7cf5bf13fee082/worktree_commit.go#L156-L158
I am not really sure why this error occurs so more research has to be done.
@phillebaba I am not sure this is an issue anymore as the e2e-github
GH action is doing exactly this check as it creates an empty repository and bootstraps via that.
Closing we are going to aim to fix this in flux v2.4 by adding the ability to set a kustomization override in the bootstrap
command of the CLI.