Documentation ¶
Overview ¶
Package conversion implements conversion utilities.
Index ¶
- Constants
- func ConvertReferenceAPIContract(ctx context.Context, c client.Client, restConfig *rest.Config, ...) errordeprecated
- func FuzzTestFunc(input FuzzTestFuncInput) func(*testing.T)
- func GetFuzzer(scheme *runtime.Scheme, funcs ...fuzzer.FuzzerFuncs) *fuzz.Fuzzer
- func MarshalData(src metav1.Object, dst metav1.Object) error
- func UnmarshalData(from metav1.Object, to interface{}) (bool, error)
- func UpdateReferenceAPIContract(ctx context.Context, c client.Client, ref *corev1.ObjectReference) error
- type FuzzTestFuncInput
Constants ¶
const (
DataAnnotation = "cluster.x-k8s.io/conversion-data"
)
Variables ¶
This section is empty.
Functions ¶
func ConvertReferenceAPIContract
deprecated
added in
v0.3.0
func ConvertReferenceAPIContract(ctx context.Context, c client.Client, restConfig *rest.Config, ref *corev1.ObjectReference) error
ConvertReferenceAPIContract takes a client and object reference, queries the API Server for the Custom Resource Definition and looks which one is the stored version available.
The object passed as input is modified in place if an updated compatible version is found.
Deprecated: Use UpdateReferenceAPIContract instead.
func FuzzTestFunc ¶ added in v0.3.0
func FuzzTestFunc(input FuzzTestFuncInput) func(*testing.T)
FuzzTestFunc returns a new testing function to be used in tests to make sure conversions between the Hub version of an object and an older version aren't lossy.
func MarshalData ¶ added in v0.3.0
MarshalData stores the source object as json data in the destination object annotations map. It ignores the metadata of the source object.
func UnmarshalData ¶ added in v0.3.0
UnmarshalData tries to retrieve the data from the annotation and unmarshals it into the object passed as input.
func UpdateReferenceAPIContract ¶ added in v0.4.3
func UpdateReferenceAPIContract(ctx context.Context, c client.Client, ref *corev1.ObjectReference) error
UpdateReferenceAPIContract takes a client and object reference, queries the API Server for the Custom Resource Definition and looks which one is the stored version available.
The object passed as input is modified in place if an updated compatible version is found.
Types ¶
type FuzzTestFuncInput ¶ added in v0.4.0
type FuzzTestFuncInput struct { Scheme *runtime.Scheme Hub conversion.Hub HubAfterMutation func(conversion.Hub) Spoke conversion.Convertible SpokeAfterMutation func(convertible conversion.Convertible) SkipSpokeAnnotationCleanup bool FuzzerFuncs []fuzzer.FuzzerFuncs }