atlassian / smith

Smith is a Kubernetes workflow engine / resource manager
Apache License 2.0
285 stars 24 forks source link

Generic controller #268

Closed ash2k closed 6 years ago

ash2k commented 6 years ago

This is a prototype of an idea we came up with @wryun. What if we package all Voyager layers into Smith and execute them in "dry run" mode from a validating admission hook? That way we can synchronously validate that all the transformations (by all layers) can be done and that eventual objects match providers' schemas. This allows for synchronous failures if the user submits an invalid object. If not do it like that then how?

I wanted to see if it is viable to extract common generic machinery and make controllers plugable into it. Looks like it is.

Work left to be done (not this PR?):

p.s. ignore first two commits. It was a fun weekend :)

ash2k commented 6 years ago

@nilebox you wouldn't believe, but I've done that already :) see last 15 commits to master. They are the preparation for this refactoring. This cannot be done with less changes - everything needs to change so... I've extracted what I could into separate commits (into master) and split this into 2 main commits.