CRD and Template Validation
What would you like to be added: Based on review of https://github.com/kudobuilder/kudo/pull/506 it was suggested that we:
- Create a Validator interface with a Validate function
- Add Validate functions to each CRD type
- Validate CRDs ranges through and calls each.
That way, skipInstance only means "do not include the Instance in the list of CRDs".
Why is this needed: We need a way to ensure that a CRD is valid
I don't know... I don't feel like we need interface for everything, I like the simplicity of having a validate function with straightforward 10 lines of code than couple of abstractions. I feel like that is more golang way to me, you just strart reading and know what is it doing. Golang is not OOP...
I can be convinced if all others feel like we need abstraction here. But overall I would not prematurely abstract when the abstraction is not (from my opinion) giving us much... (or at least I don't see the benefit)
Reading the function for validateCRDs again, I could be convinced since this only exists on the Instance as of today.
I agree we shouldn't be using interfaces for OOP, they're there to help with composition and narrowing of contract (we know that this has to be something that has a Read function for io.Reader, for example). Since we're not doing that and there's no contract to establish, maybe we don't need to do this.
@kensipe validation code changed significantly since almost a year ago. Does this ticket still apply?