Skip to content

Commit

Permalink
Add some details to the code comments
Browse files Browse the repository at this point in the history
Signed-off-by: Sergen Yalçın <[email protected]>
  • Loading branch information
sergenyalcin committed Aug 15, 2023
1 parent 3d06353 commit 3549876
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/migration/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,9 @@ func toPackageLock(u unstructured.Unstructured) (*xppkgv1beta1.Lock, error) {
return lock, nil
}

// ConvertComposedTemplatePatchesMap converts the composed templates with given conversion map
// ConvertComposedTemplatePatchesMap converts the composed templates with given conversionMap
// Key of the conversionMap points to the source field
// Value of the conversionMap points to the target field
func ConvertComposedTemplatePatchesMap(sourceTemplate xpv1.ComposedTemplate, conversionMap map[string]string) []xpv1.Patch {
var patchesToAdd []xpv1.Patch
for _, p := range sourceTemplate.Patches {
Expand Down
2 changes: 2 additions & 0 deletions pkg/migration/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,8 @@ func (d *delegatingConverter) ComposedTemplate(sourceTemplate xpv1.ComposedTempl

// DefaultCompositionConverter is a generic composition converter
// conversionMap: is fieldpath map for conversion
// Key of the conversionMap points to the source field
// Value of the conversionMap points to the target field
// Example: "spec.forProvider.assumeRolePolicyDocument": "spec.forProvider.assumeRolePolicy",
// fns are functions that manipulate the patchsets
func DefaultCompositionConverter(conversionMap map[string]string, fns ...func(sourceTemplate xpv1.ComposedTemplate) ([]xpv1.Patch, error)) ComposedTemplateConversionFn {
Expand Down

0 comments on commit 3549876

Please sign in to comment.