Documentation ¶
Overview ¶
Package transformers provide mergo transformers for Kubernetes objects.
Index ¶
- type TransformerMap
- func (s *TransformerMap) MergeListByKey(key string, opts ...func(*mergo.Config)) func(_, _ reflect.Value) error
- func (s *TransformerMap) NilOtherFields(opts ...func(*mergo.Config)) func(_, _ reflect.Value) error
- func (s *TransformerMap) OverrideFields(fields ...string) func(_, _ reflect.Value) error
- func (s TransformerMap) Transformer(t reflect.Type) func(dst, src reflect.Value) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TransformerMap ¶
TransformerMap is a mergo.Transformers implementation.
var PodSpec TransformerMap
PodSpec mergo transformers for corev1.PodSpec.
func (*TransformerMap) MergeListByKey ¶
func (s *TransformerMap) MergeListByKey(key string, opts ...func(*mergo.Config)) func(_, _ reflect.Value) error
MergeListByKey merges two list by element key (eg. merge []corev1.Container by name). If mergo.WithAppendSlice options is passed, the list is extended, while elemnts with same name are merged. If not, the list is filtered to elements in src.
func (*TransformerMap) NilOtherFields ¶
NilOtherFields nils all fields not defined in src.
func (*TransformerMap) OverrideFields ¶
func (s *TransformerMap) OverrideFields(fields ...string) func(_, _ reflect.Value) error
OverrideFields when merging override fields even if they are zero values (eg. nil or empty list).
func (TransformerMap) Transformer ¶
Transformer implements mergo.Tansformers interface for TransformenrMap.