kubernetes-client icon indicating copy to clipboard operation
kubernetes-client copied to clipboard

Add `hasSpec` Abstraction Over Kubernetes Resource

Open csviri opened this issue 3 years ago • 4 comments

Is your enhancement related to a problem? Please describe

In Java Operator SDK we would like to automate some of the aspects of dependent resource management. In a default use-case when a reconciliation happens, the spec of the target resource is compared to the spec of the actual resource. Currently we use hasMetadata as the base class, would be great to have access to the specs through some abstraction.

Describe the solution you'd like

Having hasSpec of a standalone interface or as an interface that extends hasMetadata.

Could look like this:

public interface HasSpec<T> {

T getSpec();

void setSpec(T value);

}

Describe alternatives you've considered

Alternative is read this via reflection. What is not the most elegant solution.

Additional context

No response

csviri avatar Feb 08 '22 09:02 csviri

Relates to #3586

manusa avatar Feb 08 '22 10:02 manusa

Updated the description. We will need also setSpec(T).

csviri avatar Feb 21 '22 11:02 csviri

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!

stale[bot] avatar May 30 '22 14:05 stale[bot]

Would like to re-open this as this should still be addressed, imo.

metacosm avatar Aug 10 '22 09:08 metacosm