puppetlabs / puppetserver

Server automation framework and application
https://tickets.puppetlabs.com/browse/SERVER
Apache License 2.0
292 stars 236 forks source link

(PE-36204) ensure indicator file is deleted #2753

Closed jonathannewman closed 1 year ago

jonathannewman commented 1 year ago

This moves all the CSR deletion requests to a singular function for handling the CSR deletion, which centralizes logging and provides a bottleneck for all CSR removal behaviors.

Since all calls to the "autosign" routine were always followed by calls to remove the CSR, the delete routine was moved into the autosign routine.

In the updated delete routine, a new behavior is added to look for and remove the indicator file if it is present. The delete routine needed to be moved up in the file because it is now used by some earlier functions.

Tests are updated to reflect the new behavior and ensure the file is properly deleted.