conversion

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GVKToGVR

GVKToGVR convert schema.GroupVersionKind to schema.GroupVersionResource.

func GVRToGVK

GVRToGVK convert schema.GroupVersionResource to schema.GroupVersionKind.

func KindToResource

func KindToResource(kind string) string

KindToResource convert k8s kind name to k8s resource name. like:

KindToResource(Pod) --> pods
KindToResource(Ingress) -> ingresses

func ResourceToKind

func ResourceToKind(resource string) string

ResourceToKind convert k8s resource name to k8s kind name. like:

ResourceToKind(pods) -> Pod
ResourceToKind(networkpolicies) -> NetworkPolicy

func YamlOrJsonToObject added in v0.11.0

func YamlOrJsonToObject(data []byte) (runtime.Object, *schema.GroupVersionKind, error)

YamlOrJsonToObject will decode yaml/json documents to runtime.Object and GroupVersionKind.

func YamlToJson added in v0.11.0

func YamlToJson(yamlData []byte) ([]byte, error)

YamlToJson convert yaml documents to json documents, and those are k8s resources.

Types

This section is empty.

Jump to

Keyboard shortcuts

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