Cleans up fields using filters defined in cmd/defaults.go or in -p filename. Sample JSON with filters can be found in sample/. Usage: ... | kubeformat -p filepath. Note that wildcard (*) only works for containers, and you should escape irrelevant dots with \\
Iterates over containers(container filters are defined with *, "spec.template.spec.containers.*.terminationMessagePath")
Removes empty fields
Flattens Lists
Example
TODO
Improve and unify error handling, right now its a mess
Add tests
Refactor function and variable names to be in line with conventions
Maybe add statefulness (path to filters)
Add parsing of multiple manifests (--- case)
Maybe add optional secret decoding from b64
Output in JSON
Cleanup out-of-the-box CLI flags
Read input from files cat file | kubeformat accomplishes the same
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.