-
Notifications
You must be signed in to change notification settings - Fork 2
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
ROX-18085: Allow custom post-renderer #41
Conversation
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.
@ludydoo I like the simplicity of your solution. It's way easier to understand whats going on compared to the ActionClientGetter interface.
But I think it's not good that there are 2 different approaches to PostRender. Maybe it would be better to extend the interface and it's implementation in some way that allows adding object data similar to what is done here.
helm-operator/pkg/client/actionclient.go
Line 143 in b54aa5c
postRenderer := DefaultPostRendererFunc(rm, actionConfig.KubeClient, obj) |
Didn't find a way to do that easily though, I'm curious what they have to say in the upstream PR.
aa0b3fe
to
1fe2446
Compare
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 awesome! Just one minor comment.
pkg/client/actionclient.go
Outdated
func AppendUpgradeFailureRollbackOptions(opts ...RollbackOption) ActionClientGetterOption { | ||
return func(getter *actionClientGetter) error { | ||
getter.upgradeFailureRollbackOpts = append(getter.upgradeFailureRollbackOpts, opts...) | ||
return nil | ||
} | ||
} | ||
|
||
type PostRendererProvider func(rm meta.RESTMapper, kubeClient kube.Interface, obj client.Object) postrender.PostRenderer |
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 don't like to call everything "Getter" but this would keep naming consistent across this package.
type PostRendererProvider func(rm meta.RESTMapper, kubeClient kube.Interface, obj client.Object) postrender.PostRenderer | |
type PostRendererGetter func(rm meta.RESTMapper, kubeClient kube.Interface, obj client.Object) postrender.PostRenderer |
See operator-framework/helm-operator-plugins#219