-
Notifications
You must be signed in to change notification settings - Fork 73
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
Research the best way to support advanced configuration per sync provider #405
Comments
I like the idea of a config file, its a pretty common pattern that would allow for developers to very easily interpret configurations (compared to a multi line list of startup flags), we can also create a schema definition for it to allow for linting + validation |
Ive done some more investigation into a clean method for handling per-sync configurations: Currently we are using viper to handle our flag values, out of the box viper allows for the parsing of a config file (.json/.yaml), we already have this configuration set up within
resulting in each sync provider receiving the following This flag structure feels inappropriate for our use case, instead we can update the
this means we can now pass the following configuration file:
this allows us to define configuration on a per-sync basis, using the sync URI as the map key, which we can filter for on startup, with each configuration defined as IMO this implementation keeps out configurations extremely flexible, while ensuring each syncs configuration is kept separate. It also allows us to use both flag arguments and config files (if not are used the configuration from flag arguments overwrites any duplicated keys in the configuration file) This will also make it easy to introduce the watching of these configurations: https://github.com/spf13/viper#watching-and-re-reading-config-files |
Another option is to extend the functionality of the '--uri' flag to take optionally take a json configuration object. We can identify any of the existing uri flags using the regex found in
If the string argument provided matches the regex, then we can create an 'empty configuration'. We then pass this configuration to each of the providers, deprecating the existing '--sync-provider-args' flag and maintaining the backwards compatibility of the Ive looked into implementing this with a |
Im going to implement and open a PR for the string-ified object approach: you could either pass:
or:
internally we would parse the response as a |
Hey @james-milligan, I think the config object makes sense but I'm not sure if repurposing the What do you think @toddbaert? |
I agree with this idea. |
<!-- Please use this template for your pull request. --> <!-- Please use the sections that you need and delete other sections --> ## This PR <!-- add the description of the PR here --> - introduces the `SyncProviderConfig` object and associated start flags to pass configuration to specific sync providers ### Related Issues <!-- add here the GitHub issue that this PR resolves if applicable --> #405 ### Notes <!-- any additional notes for this PR --> ### Follow-up Tasks <!-- anything that is related to this PR but not done here should be noted under this section --> <!-- if there is a need for a new issue, please link it here --> ### How to test <!-- if applicable, add testing instructions under this section --> --------- Signed-off-by: James Milligan <[email protected]> Signed-off-by: James Milligan <[email protected]> Co-authored-by: Skye Gill <[email protected]>
flagd supports various sync providers (filepath, kubernetes, http, grpc), and also supports the usage of multiple providers simultaneously (just as an example, flagd can be started to listen to an HTTP endpoint, watch a file, and connect to 2 gRPC servers).
Each of these providers may require individual configuration. For instance, each gRPC stream might need different certs, or http syncs may each require different auth headers. We currently do not have a solution to handle this sort of configuration from the command line.
We need to decide on a way to support this. It should also work well with CRs we define in the OpenFeature operator.
Ideas:
syncProvider
args, supporting key/value encoding of some kindEdit: See Jame's research/suggestions below. I'm somewhat partial to this one.
Implementation issue: open-feature/open-feature-operator#382
The text was updated successfully, but these errors were encountered: