helpers

package
v0.0.0-...-9fab673 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GroupVersionKindFrom

func GroupVersionKindFrom(gvk string) (schema.GroupVersionKind, error)

GroupVersionKindFrom converts a string to a GroupVersionKind.

func NamespacedNameFrom

func NamespacedNameFrom(name string) (types.NamespacedName, error)

NamespacedNameFrom converts a string to a NamespacedName.

func SanitizeJsonPatch

func SanitizeJsonPatch(expr string) string

SanitizeJsonPatch replace all '/' and '~' in the given JsonPath expression.

func UnmarshalYamlDocString

func UnmarshalYamlDocString(doc YamlDocString) (obj map[string]interface{}, err error)

UnmarshalYamlDocString converts a *messages.PickleStepArgument_PickleDocString into a map[string]interface{}.

func YamlToJson

func YamlToJson(in string) ([]byte, error)

YamlToJson converts naively YAML string to JSON []byte.

Types

type ResourceTable

type ResourceTable pickleTable

ResourceTable adds unmarshalling method to easily manage Resource table.

type ResourceTableRow

type ResourceTableRow struct {
	GroupVersion string
	Kind         string
	Namespace    string
	Name         string
}

ResourceTableRow describes a resource in the ResourceTable.

func UnmarshalResourceTable

func UnmarshalResourceTable(table ResourceTable) (resources []ResourceTableRow, err error)

UnmarshalResourceTable converts a *messages.PickleStepArgument_PickleTable into a list of ResourceTableRow, in which we can easily extract GroupVersionKind and NamespacedName values.

func (ResourceTableRow) GroupVersionKind

func (row ResourceTableRow) GroupVersionKind() schema.GroupVersionKind

GroupVersionKind returns the GroupVersionKind of the current resource.

func (ResourceTableRow) NamespacedName

func (row ResourceTableRow) NamespacedName() types.NamespacedName

NamespacedName returns the NamespacedName of the current resource.

type YamlDocString

type YamlDocString pickleDocString

YamlDocString adds unmarshalling method to easily manage YAML content.

Jump to

Keyboard shortcuts

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