module K8S::Util
Overview
Miscellaneous helpers
Extended Modules
Defined in:
k8s/util.crConstant Summary
-
PATH_REGEX =
/(\/|~(?!1))/
-
PATH_TR_MAP =
{"~" => "~0", "/" => "~1"}
Class Method Summary
-
.compact_map(args, &)
Yield with all non-nil args, returning matching array with corresponding return values or nils.
Instance Method Summary
-
#deep_merge(input, other, overwrite_arrays = true, union_arrays = false, keep_existing = false, merge_nil_values = false, merge_non_hash = false)
@param overwrite_arrays [Boolean] when encountering an array, replace the array with the new array @param union_arrays [Boolean] when encountering an array, use Array#union to combine with the existing array @param keep_existing [Boolean] prefer old value over new value @param merge_nil_values [Boolean] overwrite an existing value with a nil value @param merge_non_hash [Boolean] will merge
::K8S::Kubernetes::Resource
objects -
#json_patch(patch_to : Hash, patch_from : Hash)
Produces a set of json-patch operations so that applying the operations on a, gives you the results of b Used in correctly patching the Kube resources on stack updates
- #json_patch(patch_to : NamedTuple, patch_from : NamedTuple)
-
#recursive_compact(value : Hash | Array | YAML::Any | JSON::Any)
Recursive compact for Hash/Array
Class Method Detail
Yield with all non-nil args, returning matching array with corresponding return values or nils.
Args must be usable as hash keys. Duplicate args will all map to the same return value.
Instance Method Detail
@param overwrite_arrays [Boolean] when encountering an array, replace the array with the new array
@param union_arrays [Boolean] when encountering an array, use Array#union to combine with the existing array
@param keep_existing [Boolean] prefer old value over new value
@param merge_nil_values [Boolean] overwrite an existing value with a nil value
@param merge_non_hash [Boolean] will merge ::K8S::Kubernetes::Resource
objects
Produces a set of json-patch operations so that applying the operations on a, gives you the results of b Used in correctly patching the Kube resources on stack updates
@param patch_to [Hash] Hash to compute patches against @param patch_from [Hash] New Hash to compute patches "from"
Recursive compact for Hash/Array
@param hash_or_array [Hash,Array] @return [Hash,Array]