utils

package
v1.5.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyPatchNew

func ApplyPatchNew(resource, patch []byte) ([]byte, error)

ApplyPatchNew patches given resource with given joined patches

func ApplyPatches

func ApplyPatches(resource []byte, patches [][]byte) ([]byte, error)

ApplyPatches patches given resource with given patches and returns patched document return original resource if any error occurs

func ConvertToUnstructured

func ConvertToUnstructured(data []byte) (*unstructured.Unstructured, error)

ConvertToUnstructured converts the resource to unstructured format

func GetAnchorsFromMap

func GetAnchorsFromMap(anchorsMap map[string]interface{}) map[string]interface{}

GetAnchorsFromMap gets the conditional anchor map

func JoinPatches

func JoinPatches(patches [][]byte) []byte

JoinPatches joins array of serialized JSON patches to the single JSONPatch array

func JsonPointerToJMESPath added in v1.4.2

func JsonPointerToJMESPath(jsonPointer string) string

Types

type RuleType

type RuleType int

RuleType defines the type for rule

const (
	//Mutation type for mutation rule
	Mutation RuleType = iota
	//Validation type for validation rule
	Validation
	//Generation type for generation rule
	Generation
	// ImageVerify type for image verification
	ImageVerify
)

func (RuleType) String

func (ri RuleType) String() string

Jump to

Keyboard shortcuts

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