yamltojson

command module
v0.0.0-...-7e1b117 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2023 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

yamltojson

Converts kubernetes yaml files to json files.

installation

go install github.com/xonvanetta/yamltojson@latest

or this if you don't have go 1.17+

go get github.com/xonvanetta/yamltojson

Usage

This will convert a kubernetes yaml file to one json file with keys based on name+kind

The command for converting files yamltojson -file tests/cert-manager.yaml, the command will create a json file in tests/cert-manager.json

Config
$ yamltojson --help
Usage of yamltojson:
  -file value
    	Change value of File.
  -namepattern value
    	Change value of NamePattern. (default {{if or (eq .Kind "CustomResourceDefinition") (eq .Kind "Namespace")}}0{{end}}{{ .Metadata.Name }}-{{ .Kind }})
  -seperatecrds
    	Change value of SeperateCRDs. (default false)

Generated environment variables:
   CONFIG_FILE
   CONFIG_NAMEPATTERN
   CONFIG_SEPERATECRDS

Tests files

cert-manager.yaml is from https://github.com/jetstack/cert-manager/ release v1.5.4 fluxv2.yaml is from https://github.com/fluxcd/flux2/releases/download/v2.0.0-rc.1/install.yaml release v2.0.0-rc.1

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址