-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
c67492f
commit c98c20f
Showing
5 changed files
with
259 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.