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

Updating provider config #3468

Merged
merged 4 commits into from
Jun 18, 2024
Merged

Updating provider config #3468

merged 4 commits into from
Jun 18, 2024

Commits on Jun 18, 2024

  1. Protobuf changes for providers update

    This merely adds the PatchProvider rpc changes to keep the other patches
    in the same PR minimal and don't mix the RPC changes with the logic
    changes.
    jhrozek committed Jun 18, 2024
    Configuration menu
    Copy the full SHA
    4e8519e View commit details
    Browse the repository at this point in the history
  2. Extend the ProviderStore with an Update method, so far only allows up…

    …dating config
    
    The providerStore.Update method only exposes the new config as a
    parameter to change. Others might be added as we have a use-case for
    them - this is not public API.
    jhrozek committed Jun 18, 2024
    Configuration menu
    Copy the full SHA
    e74e32c View commit details
    Browse the repository at this point in the history
  3. Add a PatchProvider server handler, currently just updating the config

    Building atop the providerStore.Update method, we add a PatchProvider
    handler that so far only allows updating the config.
    jhrozek committed Jun 18, 2024
    Configuration menu
    Copy the full SHA
    e29ee60 View commit details
    Browse the repository at this point in the history
  4. Treat the provider config as an override, keep the defaults in the code

    Since storing the whole config in the database is problematic for a
    number of reasons, like hard patching or worse ability to change
    defaults, let's change the way we treat the provider configuration in
    the database. Instead of storing the full config, we treat the provider
    config as an override. To that end, we store a structure with defaults
    in the code and make all the fields in the protobuf messages optional
    which causes the resulting Go structures to have pointers to fields
    instead of direct attributes.
    
    We store the config override verbatim, after just having unmarshalled
    and marshalled back to get rid of any extra keys. Then we merge with the
    default config on retrieving the provider configuration from the
    database.
    jhrozek committed Jun 18, 2024
    Configuration menu
    Copy the full SHA
    063fc98 View commit details
    Browse the repository at this point in the history