utils

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package utils provide utilities functions to make helm-convert work

Index

Constants

This section is empty.

Variables

View Source
var K8SResourceMapping = map[string]string{
	"certificatesigningrequest": "csr",
	"clusterrolebinding":        "crb",
	"configmap":                 "cm",
	"customresourcedefinition":  "crd",
	"daemonset":                 "ds",
	"deployment":                "deploy",
	"endpoint":                  "ep",
	"horizontalpodautoscaler":   "hpa",
	"ingress":                   "ing",
	"limitrange":                "limits",
	"namespace":                 "ns",
	"networkpolicy":             "netpol",
	"persistentvolume":          "pv",
	"persistentvolumeclaim":     "pvc",
	"poddisruptionbudget":       "pdb",
	"podsecuritypolicy":         "psp",
	"replicaset":                "rs",
	"replicationcontroller":     "rc",
	"resourcequota":             "quota",
	"rolebinding":               "rb",
	"service":                   "svc",
	"serviceaccount":            "sa",
}

K8SResourceMapping map long/short resource name

Functions

func GetKindAbbreviation

func GetKindAbbreviation(kind string) string

GetKindAbbreviation return the abbreviation of a given resource

func GetPrefix

func GetPrefix(s []string) string

GetPrefix return the common prefix from a given list of string

func GetResourceFileName

func GetResourceFileName(id resid.ResId, res *resource.Resource) (string, error)

GetResourceFileName return a resource name from metadata.name

func PathExists

func PathExists(path string) (bool, error)

PathExists check if a path exist

func RecursivelyRemoveKey

func RecursivelyRemoveKey(path, key string, obj map[string]interface{}) error

RecursivelyRemoveKey of a matching key at a given path

Types

This section is empty.

Jump to

Keyboard shortcuts

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