Skip to content
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

Allow multipart yaml files #49

Open
howardjohn opened this issue Nov 19, 2020 · 4 comments · May be fixed by #50
Open

Allow multipart yaml files #49

howardjohn opened this issue Nov 19, 2020 · 4 comments · May be fixed by #50

Comments

@howardjohn
Copy link

When not piping from kubectl directly, there are cases to run neat over multipart yaml docs such as

kind: Deployment
...
---
kind: Service
...

Currently, only the first one is returned and the rest are dropped silently

@itaysk itaysk linked a pull request Nov 24, 2020 that will close this issue
@itaysk
Copy link
Owner

itaysk commented Nov 24, 2020

Hi @howardjohn ,
Currently kubectl-neat, and also the internal Neat function operates on Kubernetes resources, as opposed to general yaml documents. Multi doc yaml files are not valid Kubernetes resources, so to work around this, I hacked together a solution (#50) that converts the multidoc yaml to a Kubernetes List resource, and Neats that list. It means that you will be able to pass in a multidoc yaml but the result will be a kubernetes list. Is that acceptable solution for your case?

@jonny08152
Copy link

This is exactly what I was looking for. Converting the yamls to a valid kubernetes item list works perfectly for comparing multiple yamls in one go.

I would love to see this getting merged into the main release.

@jonny08152
Copy link

would it also be possible to sort the output list in a consistent way?

@buckleyGI
Copy link

Hi @itaysk Is it still on your radar to merge in this PR? I'm using neat in combination with ketall and it outputs only the first resource as @howardjohn mentions. Thanks for considering the merge!

kubectl get-all -n nginxsample -o yaml | k neat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants