-
Notifications
You must be signed in to change notification settings - Fork 78
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
Custom tasks not being executed when using mlDeploySecurity #609
Comments
The custom task was written by me for my current employer. Slight nuance, we deliberately hooked it up to mlDeploySecurity, as we don't always need to fully reload the certs. If we run mlDeploySecurity, everything seems clean, but when we run mlDeploy or mlRedeploy without clearing stuff first, we get the dangling CSR's. It still seems to work, but it is very confusing at the least, particularly for someone who is unaware of the nitty gritty details.. |
@mwarnes @grtjn I've opened #621 to address the need for describing how to attach custom tasks to existing tasks. The reason why the behavior in this ticket is occurring is because This is somewhat apparent if you look at the logging of running The reason for this is due to the fact that it's the underlying Because #621 now exists, I'm closing this ticket because the behavior is actually correct, and #621 will provide guidance on how to know which ml-gradle tasks should be configured to depend on a custom task. |
A custom task is defined that clears the required certificates from the system, however, it is not run when called as a dependency of mlDeploySecurity but is called when made a dependency for mlRedeploy.
Running gradle mlRedeploy with debugging shows that the clearTvmCertificates task is initialised, but is never called so the certificate is not actually deleted.
However, the certificate template properties are updated.
When this happens the template version is bumped up +1 which is causing the CSR Request to be generated
<pki:template-version>2</pki:template-version>
As such we are left with an updated Template, the original certificate and a dangling CSR Request.
Changing the build.gradle slightly so that clearTvmCertificates is now a dependency of mlRedploy instead and we see a different story. This time the clearTvmCertificates task is called and the certificate is deleted.
mlDeploySecurity.dependsOn clearTvmCertificates
The certificate template properties are updated and the template-version bumped +1 and a CSR Request generated.
This time the certificate is inserted, so the CSR Request is removed and everything is as expected.
The text was updated successfully, but these errors were encountered: