-
Notifications
You must be signed in to change notification settings - Fork 58
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
Compliance job should not push to the repo #858
Comments
@gioccher I think it is fair to say the steps to reproduce is, you need to add the step "Create only a single git data source for intended and compliance". |
ok, I think you are saying there is a race condition in which you cannot run the same job until the prior one is complete. We will soon have the ability to mark a job as is_singleton, however, these are technically different jobs. If that is the case, we would need capabilities in core to extend that. |
Yeah I'm saying that the "Generate Intended Configurations" and "Perform Configuration Compliance" jobs are incompatible with each other. I can see two solutions:
|
Would this be more accurate? the "Generate Intended Configurations" and "Perform Configuration Compliance" jobs are incompatible to run at the same time as each other. If so, yes, it makes sense that they are not intended to run at the same time, this would be true for anything touching Git, but more likely to happen in this use case than in most use cases. |
FWIW I don't know that a core enhancement is necessarily needed - the same approach there could easily be elaborated upon by Golden Config's specific jobs, i.e. having a shared Redis lock that both jobs set and check for. |
Environment
Expected Behavior
If the Intended Config and Compliance jobs run around the same time, the compliance job only updates the database based on its findings.
Observed Behavior
If the Intended Config and Compliance jobs run around the same time, the Compliance job might push to the repository the intended config generated by the other job and make the intended config job misbehave.
When the Compliance job steals the commit from the Intended config job, nautobot is not aware that there is an updated intended config: clicking on the "Intended" or "Configuration Postprocessing" links from the "Configuration Types" panel in the device details page in nautobot shows the old configurations.
I had to run the Generate Intended Configurations job again to make Nautobot realize the intended configuration changed. Nothing new got pushed to git but then nautobot was able to show the updated intended and postprocessed configs
Steps to Reproduce
The text was updated successfully, but these errors were encountered: