find

package
v0.49.3 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: Apache-2.0 Imports: 8 Imported by: 0 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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractKindFromManifest

func ExtractKindFromManifest(manifest string) string

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

func GetKubernetesFiles(baseDirectory string) []string

GetKubernetesFiles returns the list of Kubernetes files found on the local file system recursively starting at a base directory

func ReadAndSplitKubernetesFile

func ReadAndSplitKubernetesFile(file string) []string

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>

Jump to

Keyboard shortcuts

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