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

Add additional update type which will not override existing configuration #1634

Open
1 of 2 tasks
JElgar opened this issue Jul 9, 2024 · 4 comments
Open
1 of 2 tasks
Labels
needs-triage Needs eyeballs

Comments

@JElgar
Copy link

JElgar commented Jul 9, 2024

Feature Description
From my understanding there are currently 2 available update types "reset" and "merge". Reset allows you to delete some config value and merge allows you to overwrite it.

I would like to be able to only update a key in the configuration if there is not an existing value.

Use Case

We are deploying greengrass components on behalf of ours users into their AWS accounts. Sometimes we want to be able to update our default configuration without overwriting any changes the user has made (appreciate this wont help with keys users have removed).

Proposed Solution

Add an additional update type similar to merge which only updates keys which do not currently exist in the config.

  • 👋 I may be able to implement this feature request (I have very little context so unlikely I will be much use without a lot of help)
  • ⚠️ This feature might incur a breaking change (kinda maybe? - as customers may be trying to infer configuration based on past deployments)
@JElgar JElgar added the needs-triage Needs eyeballs label Jul 9, 2024
@sameerzuberi
Copy link
Member

Hi, thank you for reaching out. This seems like a specific use case that would need to be implemented on the client side rather than within Greengrass. For example, you could "merge" a config value only if it matches its set default value, otherwise you would skip the update.

@JElgar
Copy link
Author

JElgar commented Jul 16, 2024

I was looking at an approach along those lines although it doesn't seem like there's a sensible way to get the current configuration of a component in order to perform that merge. Even if there was pulling the config and doing the update outside of green grass could result in race conditions (config is updated after merge), although there might be existing solutions to that part?

@sameerzuberi
Copy link
Member

The best approach would be to use the IPC. A component can use the IPC to get either its own config or the config of any other component, and it can also update its own config. This way each component can check if the user has made any changes to the default config, and update it if need be. Here are some docs for reference: https://docs.aws.amazon.com/greengrass/v2/developerguide/ipc-component-configuration.html#ipc-operation-updateconfiguration

@alter-mage
Copy link
Member

Hi @JElgar, is this issue resolved or does this require further attention?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Needs eyeballs
Projects
None yet
Development

No branches or pull requests

3 participants