Skip to content
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

Configurable lua libs for resource actions #18296

Open
P0t4T0o opened this issue May 20, 2024 · 0 comments
Open

Configurable lua libs for resource actions #18296

P0t4T0o opened this issue May 20, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@P0t4T0o
Copy link

P0t4T0o commented May 20, 2024

Summary

Hi all!
Currently, when some custom resource action is executed, ArgoCD server runs bare lua script without importing standard libraries. This setup limits the use of custom actions only to a trivial use cases which eg. dont require manipulation with strings.

Motivation

Our team manages hundreds of ArgoCD Applications of our customers. We try to follow strict gitops model - customers have only get & sync permissions in their Applications and are supposed to manage their resources - create/update/delete only by altering the spec of their resource manifest in repository.
In order to address some aspects and improve UX, eg. when update of some service failed and needs to be retriggered, we would like to have a custom action which would do that instead of requiring customer to update their manifest with increased generation number or some dummy annotation which would trigger it.
In some cases, to make a decision, we would need string library to match particular substring or os to parse a timestamp.

Proposal

One possibility could be a new flag for ArgoCDServer eg. --lua-allow-openlib=string --lua-allow-openlib=math which would pass whitelisted libs in VM struct and then compose an array of libs in (vm VM) runLua()

Please let me know what are your thoughts. Im happy to open a PR if the proposal makes sense and aligns with a plan

@P0t4T0o P0t4T0o added the enhancement New feature or request label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant