Skip to content

feat(tfctl): add --all flag to 'reconcile' command for bulk reconciliation#1744

Open
cschindlbeck wants to merge 6 commits into
flux-iac:mainfrom
cschindlbeck:feat-add-reconcile-all
Open

feat(tfctl): add --all flag to 'reconcile' command for bulk reconciliation#1744
cschindlbeck wants to merge 6 commits into
flux-iac:mainfrom
cschindlbeck:feat-add-reconcile-all

Conversation

@cschindlbeck

@cschindlbeck cschindlbeck commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Adds --all to tfctl reconcile for bulk resource reconciliation

Adds --all / -A to tfctl reconcile for bulk resource reconciliation
Comment thread cmd/tfctl/main.go Outdated
@artem-nefedov

Copy link
Copy Markdown
Contributor

Looks fine to me, but I don't have permissions to approve in this repo

Comment thread cmd/tfctl/main.go
@alexandermarston

alexandermarston commented Apr 10, 2026

Copy link
Copy Markdown
Collaborator

Thank you for the contribution! It looks like we've got a few vulnerabilities which are blocking the pipeline - I'll get these cleared up and then review this.

@cschindlbeck

Copy link
Copy Markdown
Contributor Author

@alexandermarston thanks a bunch, can you decide if we should include commit f2dfa70 or remove, that means, should the -A flag be included, this would be consistent with the other commands, i would revert it then

@alexandermarston

Copy link
Copy Markdown
Collaborator

If we are just trying to trigger a bulk reconciliation, could we consider doing something like this? (fyi, this is what we use internally at my org)

for i in $(kubectl get terraforms.infra.contrib.fluxcd.io -n my-namespace | awk '{print $1}'); do;
kubectl annotate --namespace my-namespace --field-manager=flux-client-side-apply --overwrite terraform $i reconcile.fluxcd.io/requestedAt="$(date +%s)"
done

I prefer this way as I don't have to wait for the Replan requested... for each resource.

What are your thoughts? Perhaps we can add this to the docs.

@artem-nefedov

Copy link
Copy Markdown
Contributor

But it we already have tfctl reconcile, it should be usable for this purpose. It also adds reconcile.fluxcd.io/requestedAt annotation.
And you can call it in the loop too, but I think the point of this specific PR is to make reconcile flags similar to what suspend/resume have.

@cschindlbeck

cschindlbeck commented Apr 10, 2026

Copy link
Copy Markdown
Contributor Author

@alexandermarston
We could do that but it pushes that logic to the user side. Adding --all keeps the workflow inside tfctl while avoiding requiring custom scripting for a reasonable operation.

From my perspective, the goal of this PR was to make tfctl reconcile consistent with other commands like suspend/resume, which already support bulk operations via flags.

We can add your suggestion to the docs too in case of someone wants to skip the Reconcile requested. Or add another flag --skip-reconcile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants