Documentation ¶
Index ¶
- Variables
- func DeepCopyJSON(x map[string]interface{}) map[string]interface{}
- func DeepCopyJSONValue(x interface{}) interface{}
- func In(strings []string, s string) bool
- func IsStrictDecodingError(err error) bool
- func MergeKVs(toMerge map[string]string, toBeMerged map[string]string) map[string]string
- func MergeResources(toMerge corev1.ResourceList, toBeMerged corev1.ResourceList) corev1.ResourceList
- func NewStrictDecodingError(errors []error) error
- func ParseOSS(address string) (endpoint, bucket, modelPath string, err error)
- func ParseURI(uri string) (protocol string, address string, err error)
- func Patch(ctx context.Context, k8sClient client.Client, pointerObj interface{}) error
- type UnstructuredConverter
Constants ¶
This section is empty.
Variables ¶
var ( // DefaultUnstructuredConverter performs unstructured to Go typed object conversions. DefaultUnstructuredConverter = &unstructuredConverter{ mismatchDetection: parseBool(os.Getenv("KUBE_PATCH_CONVERSION_DETECTOR")), comparison: conversion.EqualitiesOrDie( func(a, b time.Time) bool { return a.UTC() == b.UTC() }, ), } )
Functions ¶
func DeepCopyJSON ¶
DeepCopyJSON deep copies the passed value, assuming it is a valid JSON representation i.e. only contains types produced by json.Unmarshal() and also int64. bool, int64, float64, string, []interface{}, map[string]interface{}, json.Number and nil
func DeepCopyJSONValue ¶
func DeepCopyJSONValue(x interface{}) interface{}
DeepCopyJSONValue deep copies the passed value, assuming it is a valid JSON representation i.e. only contains types produced by json.Unmarshal() and also int64. bool, int64, float64, string, []interface{}, map[string]interface{}, json.Number and nil
func IsStrictDecodingError ¶
IsStrictDecodingError returns true if the error indicates that the provided object strictness violations.
func MergeKVs ¶
MergeKVs will merge kvs in toBeMerged to toMerge. If kvs exist in toMerge, they will be replaced.
func MergeResources ¶
func MergeResources(toMerge corev1.ResourceList, toBeMerged corev1.ResourceList) corev1.ResourceList
MergeResources will merge resources in toBeMerged to toMerge. If resources exist in toMerge, do nothing. If not exist, will set the value in toBeMerged to toMerge.
func NewStrictDecodingError ¶
NewStrictDecodingError creates a new strictDecodingError object.
Types ¶
type UnstructuredConverter ¶
type UnstructuredConverter interface { ToUnstructured(obj interface{}) (map[string]interface{}, error) FromUnstructured(u map[string]interface{}, obj interface{}) error }
UnstructuredConverter is an interface for converting between interface{} and map[string]interface representation.