-
Notifications
You must be signed in to change notification settings - Fork 405
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
Investigate the service catalog defaults and migrate to CRDs if needed #2837
Comments
Defaults mentioned in the description can be applied by the client app which uses (imports) the API. The sequence of the code can looks like:
The original API server executes the The webhook which applies defaults could looks like:
|
The current Service Catalog implementation (with API server) uses the scheme.Default method only in the API Server. There is no any other place with a scheme.Default() method call. Some of setting default values logic are implemented in other place, for example: We do not see any advantages to have the defaulting logic splitted into defaults (generated by defaulter-gen) and webhooks. The idea is to have it in one place - in the Webhook. We prefer to remove the defaulter-gen approach. |
About your approach with webhookBaase on your snippet I assume that My questions
My suggestionIf defaults are used only it two places: if spec.RelistBehavior == "" {
spec.RelistBehavior = ServiceBrokerRelistBehaviorDuration
} and // If not specified, make the SecretName default to the binding name
if binding.Spec.SecretName == "" {
binding.Spec.SecretName = binding.Name
} and if adding new defaults using then my suggestion is to remove the |
The defaulter-gen tool scans for top level types and generate efficient defaulters for an entire object from the sum of the SetDefault_XXX methods contained in the object tree. More about it in the tool description. So the way to use it is implement SetDefault_ methods and run defaulter-gen tool. |
Description
The Service Catalog api-server uses the defaults. Those defaults are generated by defaulter-gen. For now, I do not know how they are used. Maybe they will work as they are or maybe we will need to implement it in mutating webhook.
AC:
The text was updated successfully, but these errors were encountered: