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

JSONPath selection in PrinterColumn #70

Open
snowdrop-bot opened this issue Apr 30, 2021 · 0 comments
Open

JSONPath selection in PrinterColumn #70

snowdrop-bot opened this issue Apr 30, 2021 · 0 comments

Comments

@snowdrop-bot
Copy link

As today the @PrinterColumn annotation can only be set on a field, but in some case it would be nice to have the option to set in on a type, i.e. on a CustomResource

with the go sdk, one can do something like:

kubebuilder:printcolumn:name="provider",type=string,JSONPath=`.spec.runtime.provider`,description="provider"

but I don't a similar option with the java operator sdk

My use case is that I have a Java class used in both the spec and the status and I want to print the same field from spec and status but with a different name.

public class ConnectorSpec {    
    private DeploymentRef deployment;
}
public class ConnectorStatus {    
    private DeploymentRef deployment;
}

with the go sdk, I could write something like

kubebuilder:printcolumn:name=name="foo",type=string,JSONPath=`.spec.deployment.field`"
kubebuilder:printcolumn:name=name="bar",type=string,JSONPath=`.status.deployment.field`

I can workaround this by in-lining classes in the spec/status or having two distinct classes but since the information are exactly the same, it would put more maintenance


fabric8io#3069


$upstream:3069$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants