Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractKindFromManifest ¶
ExtractKindFromManifest tries to extract the Kind value from a Kubernetes resource string It returns an empty string, if the Kind cannot be found, or if the string value is not a valid Kubernetes resource
func GetKubernetesFiles ¶
GetKubernetesFiles returns the list of Kubernetes files found on the local file system recursively starting at a base directory
func ReadAndSplitKubernetesFile ¶
ReadAndSplitKubernetesFile reads and split a single manifest file that may contain several Kubernetes resources into an array of resources (as string) If the file contains a single K8s resource, the returned array will contain a single element
Types ¶
type KubernetesAPI ¶
type KubernetesAPI struct { APIVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` Metadata struct { Name string `yaml:"name"` Namespace string `yaml:"namespace"` Labels struct { Source string `yaml:"source"` } `yaml:"labels"` } `yaml:"metadata"` }
KubernetesAPI is a minimal struct for unmarshaling kubernetes configs into
func GetYamlInfo ¶
func GetYamlInfo(yamlContent string) (*KubernetesAPI, error)
GetYamlInfo unmarshal the YAML into a Kubernetes meta structure that is useful to ensure the unmarshaled YAML is a Kubernetes resource definition. The structure will then contain basic K8S object meta
func (KubernetesAPI) URI ¶
func (m KubernetesAPI) URI() string
URI returns a unique identifier referencing the resource It uses the following patterns: /api/<apiversion>/<kind>/<name> /api/<apiversion>/<kind>/<namespace>/<name>