k8sschema

package
v0.3.13 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 56 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToLiasonScheme

func ConvertToLiasonScheme(obj runtime.Object) (newobj runtime.Object, err error)

ConvertToLiasonScheme converts objects to liason type

func ConvertToPodSpec

func ConvertToPodSpec(podspec *corev1.PodSpec) core.PodSpec

ConvertToPodSpec podspec to core pod spec

func ConvertToPreferredVersion

func ConvertToPreferredVersion(obj runtime.Object, clusterSpec collecttypes.ClusterMetadataSpec, setDefaultValuesInYamls bool) (newobj runtime.Object, err error)

ConvertToPreferredVersion converts obj to a preferred Version

func ConvertToSupportedVersion

func ConvertToSupportedVersion(obj runtime.Object, clusterSpec collecttypes.ClusterMetadataSpec, setDefaultValuesInYamls bool) (runtime.Object, error)

ConvertToSupportedVersion converts obj to a supported Version

func ConvertToV1PodSpec

func ConvertToV1PodSpec(podSpec *core.PodSpec) corev1.PodSpec

ConvertToV1PodSpec podspec to v1 pod spec

func ConvertToVersion

func ConvertToVersion(obj runtime.Object, dgv schema.GroupVersion) (newobj runtime.Object, err error)

ConvertToVersion converts objects to a version

func GetGVKNFromK added in v0.3.13

func GetGVKNFromK(k K8sResourceT) (group string, version string, kind string, metadataName string, err error)

GetGVKNFromK gets the GVK and metadata.name information for a K8s resource

func GetInfoFromK8sResource

func GetInfoFromK8sResource(k8sResource K8sResourceT) (kind, apiVersion, name string, err error)

GetInfoFromK8sResource returns some useful information given a k8s resource

func GetK8sResourcesWithPaths

func GetK8sResourcesWithPaths(k8sResourcesPath string, currDirOnly bool) (map[string][]K8sResourceT, error)

GetK8sResourcesWithPaths gets the k8s resources from a folder along with the relaive paths where they were found. Mutiple resources maybe specified in the same yaml file.

func GetKubernetesObjsInDir

func GetKubernetesObjsInDir(dir string) []runtime.Object

GetKubernetesObjsInDir returns returns all kubernetes objects in a dir

func GetOnlyGVKInfoFromK8sResource added in v0.3.13

func GetOnlyGVKInfoFromK8sResource(k8sResource K8sResourceT) (kind, apiVersion string, err error)

GetOnlyGVKInfoFromK8sResource returns the Group Version Kind information given a k8s resource

func GetSchema

func GetSchema() *runtime.Scheme

GetSchema returns the scheme

func Intersection

func Intersection(objs1 []runtime.Object, objs2 []runtime.Object) []runtime.Object

Intersection finds overlapping objects between the two arrays

Types

type K8sResourceT

type K8sResourceT = map[string]interface{}

K8sResourceT represents type used to process K8s objects. Not using type alias breaks parameterizer currently.

func GetK8sResourcesFromYaml added in v0.3.6

func GetK8sResourcesFromYaml(k8sYaml string) ([]K8sResourceT, error)

GetK8sResourcesFromYaml decodes k8s resources from yaml

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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