kubegen icon indicating copy to clipboard operation
kubegen copied to clipboard

validation

Open errordeveloper opened this issue 7 years ago • 3 comments

We can do deep validation, but perhaps using the API schema is doable, or kubeval may be a nicer option.

Also, kubetest hooks could be built-in.

cc @garethr

errordeveloper avatar Jan 25 '18 13:01 errordeveloper

Kubeval can be used as a library (https://github.com/garethr/kubeval#library) for this kind of purpose. Over time I'd see that being more interesting than the CLI, because it means everyone doesn't have to recreate the wheel. Happy to help as time permits with hooking that up.

garethr avatar Jan 28 '18 13:01 garethr

@garethr thanks, I'll look into this soon.

I have a few things in mind, essentially I'd like to see what we can do avoid some common pitfalls:

  • referencing an object that is not defined in a kubegen module (e.g. volume, serviceaccount or configmap)
  • label selectors in a service not matching any pods
  • misuse of port mappings and hostNetwork

Seems like some of this would be kubetest territory, isn't it?

errordeveloper avatar Jan 29 '18 12:01 errordeveloper

Correct. I've not had much chance to work on kubetest of late, although the intent is to make it consumable as a library in the same way. And also to have a way of bundling up test like that. But time is not always my friend. Happy to chat/help where I can mind.

garethr avatar Jan 29 '18 15:01 garethr