Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for category-based manifest pre-processors #212

Merged
merged 5 commits into from
Jun 9, 2023

Conversation

ulucinar
Copy link
Collaborator

@ulucinar ulucinar commented Jun 7, 2023

Description of your changes

This PR adds support for category-based manifest pre-processors which can optionally be registered with a migration registry and are called before any converters are called. They cannot mutate resources (this is the job of converters) and they can only be used to extract information from the manifests belonging to a specific category such as the managed resources or compositions. Pre-processors can be used to initialize converters with information extracted from the manifests emitted by a source.

Following changes are also introduced in this PR:

  • Support for Lock.pkg converters
  • Use meta.RESTMapper for converting from GVKs to GVRs in migration.KubernetesSource and remove all references of meta.UnsafeGuessKindToResource.
  • Fix a panic when no converters act on an observed Configuration.meta

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

@ulucinar ulucinar force-pushed the lock-converters branch 2 times, most recently from 4bddaa0 to c3898e0 Compare June 8, 2023 13:49
…tesSource

- Use the same cache dir as kubectl for migration.KubernetesSource's
  disk cached discovery client.
- Remove all usages of meta.UnsafeGuessKindToResource.

Signed-off-by: Alper Rifat Ulucinar <[email protected]>
…ation.KubernetesSource

Signed-off-by: Alper Rifat Ulucinar <[email protected]>
Copy link
Member

@sergenyalcin sergenyalcin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ulucinar LGTM!

@ulucinar ulucinar merged commit aaafdd4 into crossplane:main Jun 9, 2023
@ulucinar ulucinar deleted the lock-converters branch June 9, 2023 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants