-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(workspace): don't delete directory on every reconciliation #276
Conversation
Signed-off-by: Arthur Loiselle <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
I'm wondering why the CI pipeline didn't run on this PR? I'm reasonably sure the fix is fine but I'd feel a lot better if the CI jobs had run. |
Hi @bobh66, we have an issue with the multiple runner label selection from yesterday in reusable workflows. It should be fixed after the merge of upbound/official-providers-ci#209 @arththebird thanks a ton for this contribution, just amazing! 🥇 |
My pleasure, thank you for the fast review and merge 🙌 Not sure how the release cycle for this provider is setup, I'm wondering when can we expect this to be released officially? |
@arththebird I had an internal chat with @turkenf, we target the release for this Thursday 👍 |
Installed the latest release. |
@project-administrator do the provider logs indicate that terraform init is being run every reconciliation? Is it possible that go-getter is updating the timestamp of the directory on every reconciliation loop? |
@bobh66 checked that and verified that checksums never match:
So now it's the checksum calculation taking smth into account that is not there. I can see that GenerateChecksum uses the following command:
With our config it always picks up more files than needed:
None of these are present in the remote git repo... |
I see the same thing, but I think @bobh66 theory about go-getter updating the timestamp makes sense because if I check the |
These files should be ignored when checksum is calculated.
|
Also, does it make sense to calculate the checksum of the URL address only for the remote repository module source? Why do we need to fetch files each time to calculate the checksum? |
We need to pull the content of the repo (using git fetch/pull) to determine if the content of the repo has changed. We can't assume that the repo is static. |
Do you think it's a good idea to introduce an optional parameter to control how the checksum is calculated? (repo URL vs repo contents). |
@project-administrator it's an interesting point - with the existing implementation if the remote URL changes it will now Since we don't require the use of a I wonder if a source of Though that still doesn't help with the remote URL changing - that we would still need to check for explicitly. @ytsarev - any thoughts? |
@bobh66 I like the idea. We can create something like |
Thanks @ytsarev - |
Also should we save the current Remote |
Description of your changes
Stop removing the Workspace directory on every reconciliation. This is no longer needed as the bug in
go-getter
was fixed in v1.7.5 andgo-getter
was upgraded to latest by Renovate in this PR.Not removing the workspace directory also results in
terraform init
not being run every time when there's no change because the checksum is the same. This effectively allow usingmax-reconcile-rate > 0
while using the plugin cache (issues can still happen if a workspace is applying while another one is being init, but it happens much less frequently than before when there's no changes).Fixes #275
Fixes #230
I have:
make reviewable
to ensure this PR is ready for review.How has this code been tested
make local-deploy
.terraform
directory in the workspace directory and notice that it doesn't get deleted on every reconciliation