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

[v14] Update generic storage service to support validation and custom keys #46453

Merged
merged 1 commit into from
Sep 11, 2024

Commits on Sep 10, 2024

  1. Update generic storage service to support validation and custom keys (#…

    …46319)
    
    Adds two new optional configuration options to the generic.Service:
    ValidateFunc and KeyFunc.
    
    ValidateFunc is a custom function that is called prior to persisting
    a resource in the backend. If the function returns an error, the
    resource is not stored and the error is returned to users.
    
    KeyFunc is a custom function used to derive the key for a particular
    resource. By default the generic service uses the metadata name as
    the key, however, in some scenarios more control over the key might
    be desired. For instance, a singleton resource might want to enforce
    that the key is also a static value instead of something that a
    user may supply.
    rosstimothy committed Sep 10, 2024
    Configuration menu
    Copy the full SHA
    01635a1 View commit details
    Browse the repository at this point in the history