-
Notifications
You must be signed in to change notification settings - Fork 252
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
feat: allow injecting schema into lifecycle hook #4402
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Philippe Scorsolini <p.scorsolini@gmail.com>
❗ By default, the pull request is configured to backport to all release branches.
|
// Skip unknown object | ||
return nil, nil | ||
return object, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is already covered by #4282, I do think it's the right thing to do.
@@ -144,7 +145,7 @@ func (data *data) LifecycleHook( | |||
return object, nil | |||
} | |||
|
|||
decoder := scheme.Codecs.UniversalDeserializer() | |||
decoder := serializer.NewCodecFactory(scheme.Scheme).UniversalDeserializer() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be better to move this to a builder and only create it once.
ctx context.Context, | ||
operationType plugin.OperationVerb, | ||
schema *runtime.Scheme, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel it could be passed through a builder or something instead of adding one more parameter.
An attempt at fixing the root cause of #4286, mostly a POC, I feel it could be improved.