Closed infogulch closed 4 years ago
Good catch! I'd probably consider this a bug, as that should be the intended behavior.
I think I'll fix this as well as output a plan file even when the desired state matches the actual state. I found that when testing this locally, that if my old plan file sticks around, you can end up double-applying if you try to apply after doing a plan with no changes. I agree that it should be an optional flag. ๐
Also noticed, if planning does not emit any changes, it will not write anything to or create the indicated plan file. For automation I think it would be better to emit an empty plan file (or a plan with an empty list etc).
I created a new release to apply to a new environment after a previous release successfully applied on the dev environment. But the deploy/apply to dev (which had no changes) failed with:
Given that this tool is intended to be used with automation to apply desired state configuration, if no changes are required to make the current state match the desired state that should be represented as a success to the controlling automation framework.
I can imagine why one might want to fail if there were no changes and you expected there to be changes, but imo that should be an optional flag, not the default.