Git Product home page Git Product logo

splinter's Introduction

Splinter

Simple tool to split or flatten kubernetes manifests.

It is often the case that I will use helm template where certain values are not supported and end up with a single massive manifest which is messy to work with.

Instead, I would prefer to have multiple smaller manifests separated by resource kind.

Usage

Commands

Command Subcommand Description
splinter split split a single manifest into multiple manifests organized by resource kind
splinter merge merge individual manifests into a single manifest

Flags

Flag Required Description Command
--include, -i false optional flag to set what files or directories to include all
--kustomize, -k false spit out a kustomization.yaml for the splintered or merged manifest(s) all
--output, -o false directory to write manifest(s) to all
--delete, -d false delete all files used when merging manifests merge
--std-out false print to stdout instead of writing to disk merge

Examples

splinter split --input examples/metallb.yaml --output examples/split/
splinter split examples/metallb.yaml -o examples/split/
splinter merge examples/split/ -o examples/flatten/my-manifest.yaml

You can also pipe from stdin

helm template my-release sealed-secrets/sealed-secrets | splinter split -o my-dir/
helm template my-release sealed-secrets/sealed-secrets | splinter split -i anotherfile.yaml -o my-dir/

Installation

Go:

go install github.com/kdwils/splinter@latest

Github:

check out the latest release

splinter's People

Contributors

kdwils avatar dependabot[bot] avatar github-actions[bot] avatar

Stargazers

Josh Kasuboski avatar

Watchers

 avatar

splinter's Issues

๐Ÿ› [BUG] - merge flag causes command to fail due to defaulting output path to a directory instead of a file path

Description

merge flag causes command to fail due to defaulting output path to a directory instead of a file path

Reproduction steps

go run main.go split --merge examples/split

results in an exit code of 1 as we attempt to write to a directory instead of a file

Logs

Error: open /Users/kylewilson/go-work/src/github.com/kdwils/splinter: is a directory
Usage:
  splinter [flags]

Flags:
      --config string        config file (default is $HOME/.splinter.yaml)
  -e, --exclusions strings   files or directories to exclude
  -h, --help                 help for splinter
  -i, --input strings        provide /path/to/input/ or input.yaml
  -k, --kustomize            spit out a kustomization.yaml
      --merge                merge splintered manifests back together
  -o, --output string        provide /path/to/output/dir (default "/Users/kylewilson/go-work/src/github.com/kdwils/splinter")
  -t, --toggle               Help message for toggle

open /Users/kylewilson/go-work/src/github.com/kdwils/splinter: is a directory

OS

Mac

๐Ÿ› [BUG] - splinter includes yaml files that are not kubernetes manifests

Description

splinter includes yaml files that are not kubernetes manifests, and therefore creates invalid manifests

instead, splinter should ignore any files that are not valid kubernetes manifests

Reproduction steps

run splinter in a directory where yaml files exists but are not kuberentes resources

Logs

No response

OS

Linux

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.