Open lburgazzoli opened 3 years ago
I can think of two options at the moment: either a class level annotation allowing you to specify which path you want to add as a printer column, similarly to what the go sdk does, or make the @PrinterColumn
annotation multiple so that a given field could be annotated with different values, adding a predicate field to determine how to activate a given version.
The first option is most likely simpler to implement but that decouples the annotation from the field it's targeting making it more difficult to maintain. The second option doesn't have that disadvantage but it is probably more complex to implement and possibly to understand depending on how complex the activation predicate could be.
What do you think, @iocanel @manusa?
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!
@metacosm @iocanel this is how it is implemented din strimzi: https://github.com/strimzi/strimzi-kafka-operator/blob/a89f9b466a79b36d49b6b7fcdd120ad9b1c6cec4/api/src/main/java/io/strimzi/api/kafka/model/KafkaConnector.java#L53-L78
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!
still relevant
Are there any plans on implementing this enhancement in the near future?
In order to build CRDs in respect common api conventions (https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties) it would be really necessary to provide printer columns that are defined using a JsonPath like this .status.conditions[?(@.type=="Ready")].status
This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!
Hi @metacosm, What's the status of this issue? I'm planning the features to be completed in scope of v7.0.
I haven't looked at this in a long time and probably don't have time to take it on anymore. Feel free to re-assign it to someone else.
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:
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.
with the go sdk, I could write something like
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