-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: add manual layer sync #321
Conversation
LucasMrqes
commented
Aug 30, 2024
•
edited
Loading
edited
@LucasMrqes If you create a TerraformRun directly that would be easier I think and should still work, you'd have to make sure there's no other TerraformRun running but apart from that it should be straightforward to implement plan/apply buttons |
I think using the controller to generate the run is a better way. I tried to create the run resource with the server and encountered the following issues:
wdyt @Alan-pad ? |
edbd316
to
af35f81
Compare
I think we can adapt the controller logic so the new runs are picked up |
Implementing this feature with a tfrun creation requires us to rework the logic of the layer controller. This is something that we plan to do, but since this feature is requested a lot by Burrito users, we will merge this as is and work on a rework on future versions of Burrito. |
d20478d
to
19b6e7b
Compare
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.
Great feature! 👏
// Remove the annotation to avoid running the sync again | ||
err := annotations.Remove(context.Background(), r.Client, t, annotations.SyncNow) | ||
if err != nil { | ||
log.Errorf("Failed to remove annotation %s from layer %s: %s", annotations.SyncNow, t.Name, err) | ||
} |
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.
Removing the annotation right away is causing another reconciliation right?
Does the layer end in a NoSyncScheduled
status just a few seconds later? Does it impact the Server API in its SyncLayerHandler
?
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.
The layer controller creates a run, and the run controller locks the layer related to a this new run until the run succeeds or fails. Since the layer is locked during the whole duration of the run, this should not cause any issue.