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

ROX-18085: Allow custom post-renderer #41

Merged
merged 4 commits into from
Jul 11, 2023
Merged

Conversation

ludydoo
Copy link
Contributor

@ludydoo ludydoo commented Jun 30, 2023

Copy link

@johannes94 johannes94 left a 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.

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.

Copy link

@johannes94 johannes94 left a 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.

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
Copy link

@johannes94 johannes94 Jul 11, 2023

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.

Suggested change
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

@ludydoo ludydoo merged commit 08cc945 into main Jul 11, 2023
4 checks passed
@ludydoo ludydoo deleted the ROX-18085-custom-postrenderer branch July 11, 2023 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants