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

Mark crd spec as required

Open shawkins opened this issue 4 years ago • 12 comments

When extending CustomResource I would like to mark the spec as required. The NotNull annotation however only seems to work on fields, and not methods, so this does not seem possible.

cc @metacosm

shawkins avatar May 10 '21 12:05 shawkins

Damn! 😓

metacosm avatar May 10 '21 19:05 metacosm

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 Aug 08 '21 20:08 stale[bot]

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 Nov 07 '21 13:11 stale[bot]

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 Feb 06 '22 09:02 stale[bot]

Hi @metacosm, @shawkins,

Was this already fixed? is it still applicable?

manusa avatar Feb 14 '22 06:02 manusa

No, this hasn't been fixed but not sure how important it is

metacosm avatar Feb 14 '22 07:02 metacosm

No, this hasn't been fixed but not sure how important it is

It's just a nice to have for completeness.

shawkins avatar Feb 14 '22 12:02 shawkins

We could put the @NotNull annotation on the spec field of CustomResource, though that might be a little heavy-handed…

metacosm avatar Feb 14 '22 14:02 metacosm

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 15 '22 16:05 stale[bot]

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 Aug 31 '22 01:08 stale[bot]

Regarding version 7.0, one of the ideas is to completely remove CustomResource class in favor of specific interfaces for HasSpec, HasStatus, and so on (#2829 comment).

I'm not sure how this issue might play in conjunction with these interfaces.

Thoughts?

manusa avatar Mar 05 '24 17:03 manusa

I guess having something implements the HasSpec interface would need to trigger the required clause on the spec. Same thing for HasStatus.

metacosm avatar Mar 06 '24 09:03 metacosm