MCPcopy Create free account
hub / github.com/crossplane-contrib/function-patch-and-transform / ResolveTransforms

Function ResolveTransforms

patches.go:51–60  ·  view source on GitHub ↗

ResolveTransforms applies a list of transforms to a patch value.

(ts []v1beta1.Transform, input any)

Source from the content-addressed store, hash-verified

49
50// ResolveTransforms applies a list of transforms to a patch value.
51func ResolveTransforms(ts []v1beta1.Transform, input any) (any, error) {
52 var err error
53 for i, t := range ts {
54 if input, err = Resolve(t, input); err != nil {
55 // TODO(negz): Including the type might help find the offending transform faster.
56 return nil, errors.Wrapf(err, errFmtTransformAtIndex, i)
57 }
58 }
59 return input, nil
60}
61
62// ApplyFromFieldPathPatch patches the "to" resource, using a source field
63// on the "from" resource. Values may be transformed if any are defined on

Callers 3

TestResolveTransformsFunction · 0.85
ApplyFromFieldPathPatchFunction · 0.85

Calls 1

ResolveFunction · 0.85

Tested by 1

TestResolveTransformsFunction · 0.68