Closed howardjohn closed 3 months ago
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 (https://github.com/itaysk/kubectl-neat/pull/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?
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.
would it also be possible to sort the output list in a consistent way?
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
kubectl-neat is meant to be operating on the output of kubectl, and I don't think kubectl ever emits multipart yaml, instead it emits a "List" kind which kubectl-neat already supports. So I'm closing this one.
When not piping from
kubectl
directly, there are cases to runneat
over multipart yaml docs such asCurrently, only the first one is returned and the rest are dropped silently