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

Implement PackageVariantSet v1alpha2 #3930

Merged
merged 26 commits into from May 10, 2023

Conversation

johnbelamaric
Copy link
Contributor

This PR implements the PackageVariantSet design described in https://github.com/GoogleContainerTools/kpt/blob/main/docs/design-docs/08-package-variant.md.

@johnbelamaric johnbelamaric requested a review from a team as a code owner April 25, 2023 21:57
@johnbelamaric johnbelamaric changed the title Add the PackageVariantSet v1alpha2 API types Implement PackageVariantSet v1alpha2 Apr 25, 2023
@johnbelamaric johnbelamaric marked this pull request as draft April 25, 2023 21:57
@johnbelamaric
Copy link
Contributor Author

johnbelamaric commented May 2, 2023

I'd like this to start getting reviews. A few notes:

  • I think the test failure is a flake?
  • This does not yet implement conversion webhooks from v1alpha1 to v1alpha2. I think that's OK, maybe we should punt on that. There is some conversion code but it does not cover the entire API, and getting the webhook creation and setup is a fair bit of work for not much benefit on an alpha that is not used a lot yet. We'll have to release note the change. I can update the existing Nephio references.
  • There's quite a bit of code here, reviewing commit-by-commit may help.

@johnbelamaric johnbelamaric self-assigned this May 2, 2023
@johnbelamaric johnbelamaric marked this pull request as ready for review May 2, 2023 18:39
for _, u := range uList.Items {
result = append(result, pvContext{
template: target.Template,
repoDefault: u.GetName(),
Copy link
Contributor

Choose a reason for hiding this comment

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

If selectors matches arbitrary objects, is it still correct to use the name of the resource here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes; at least, that is how it is specified in the design :).

This is just the default. The user can override it using an expression based on the object (for example, target.annotations['repo-name']). That comes later in the PackageVariantTemplate.

@johnbelamaric
Copy link
Contributor Author

Rebased

Copy link
Contributor

@natasha41575 natasha41575 left a comment

Choose a reason for hiding this comment

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

LGTM, but I think we should also get @mortent's approval on this one.

I appreciate the thorough unit tests btw!

Copy link
Contributor

@mortent mortent left a comment

Choose a reason for hiding this comment

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

Looks good. We have completed this months releases of kpt and Porch, so feel free to merge this.

| repoDefault | The default repository name based on the targeting criteria. |
| packageDefault | The default package name based on the targeting criteria. |
| upstream | The upstream PackageRevision. |
| repository | The downstream Repository. |
Copy link

Choose a reason for hiding this comment

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

Add target here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's described in the paragraph below, because it's contented varies based on the type of target. But I will add it here in a follow up PR.

@johnbelamaric johnbelamaric merged commit 565305a into kptdev:main May 10, 2023
15 checks passed
johnbelamaric added a commit to mortent/kpt that referenced this pull request Sep 18, 2023
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.

None yet

4 participants