utils

package
v1.1.12 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

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 TransformPatches added in v1.1.9

func TransformPatches(patches []kyverno.Patch) (patchesBytes [][]byte, err error)

TransformPatches converts mutation.Patches to bytes array

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
	//All type for other rule operations(future)
	All
)

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