-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(kubernetes): make reconcile support arrays #112
Conversation
docs/jsonnet/expected-structure.md
Outdated
|
||
Tanka evaluates the `main.jsonnet` file of your [Environment](/environments) and | ||
filters the output (either Object or Array) for valid Kubernetes objects. | ||
An object is considered valid if it has both, a `kind` and a `metadata.name` set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's usually the case that Kubernetes deals in GVK (Group-Version-Kind) + Name tuples when uniquely identifying resources. It's probably better for tanka to output any leaf node that exhibits the structure:
// Assuming github.com/stretchr/objx
obj.Get("apiVersion").IsStr() &&
obj.Get("kind").IsStr() &&
obj.Get("metadata.name").IsStr()
I believe anything other than this format will fail validation anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @lawrencejones but also this remark seems inaccurate. reconcile.go
seems to only be logging for kind
and apiVersion
right now. We should be checking for all three and document them here.
Hey @sh0rez, I think we have a branch that might do this, along with a few clean-ups we've made along the way. We'll push it in about an hour if you can wait for that! I think your documentation is looking ace though 👌 |
#109 is a separate take on this, hopefully with some simplifications that make tanka a bit easier to work on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LGTM, needs a few changes.
docs/jsonnet/expected-structure.md
Outdated
|
||
Tanka evaluates the `main.jsonnet` file of your [Environment](/environments) and | ||
filters the output (either Object or Array) for valid Kubernetes objects. | ||
An object is considered valid if it has both, a `kind` and a `metadata.name` set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @lawrencejones but also this remark seems inaccurate. reconcile.go
seems to only be logging for kind
and apiVersion
right now. We should be checking for all three and document them here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
That's a good idea, just not in this particular PR. Will open an issue, let's address once #111 is done |
Adds array support for Reconcile.
Also documents the expected jsonnet structure. Fixes #110