crumbhole / argocd-lovely-plugin

A plugin to make Argo CD behave like we'd like.
BSD 3-Clause "New" or "Revised" License
399 stars 26 forks source link

lovely plugin does not support ../ in kustomization.yaml #68

Closed shanproofpoint closed 2 years ago

shanproofpoint commented 2 years ago

everything seems to be in working order when kustomization.yaml does not reference ../ but as soon as you include a base in the parent directory (at the same level at the directory polled by lovely plugin) everything breaks because lovely plugin does not copy all the resources like argocd kustomization support does. (kustomization including parent directory content for base works in native argocd)

Joibel commented 2 years ago

Please see #66 and the resolution of that. See if that works for you.

shanproofpoint commented 2 years ago

@Joibel thank you! whole sale change in functionality is unexpected XD Btw how does copying the directory prevent racing conditions tho? when you merge it back into the final collection of yaml, the newly processed thing may step on something already generated earlier by another thread no?


on another note having trouble finding documentation and example of lovely plugin post processors (plugins on yaml) will continue hunting around...

Joibel commented 2 years ago

It's currently not the default behaviour. I'd like to remove the requirement to configure this, but I haven't decided how. The copy of the directory is not to prevent race conditions. It is to prevent lovely running and modifying the directory, and then being asked to run again in the same directory, where the files will have been already modified by the first run. Lovely doesn't merge it back into anything, it takes the yaml, renders it to the final version of yaml in memory and feeds that in memory copy directly to ArgoCD to put in your cluster. ArgoCD will separate up the individual application rendering to prevent the applications from interfering with each other. The lock is just because we're performing git operations to reset the repository back to how it should be, and ArgoCD tell us to take that lock if we want to do that.

Plugin documentation is here and there is a noddy example here (see env.txt for configuring it)

shanproofpoint commented 2 years ago

Thank you for this explanation Joibel! I now understand should the parent location's contents change, it can make the rendering of this application's yaml inconsistent.

shanproofpoint commented 2 years ago

(and thus "locking" on the plugin may not be a heavy as i thought it would be)

shanproofpoint commented 2 years ago

I apologize. I was confused. will recheck. thanks again Joibel!