kpt
kpt copied to clipboard
Porch allows duplicate package revisions to be created
Expected behavior
Porch should not allow a package revision to be created that matches the package name and revision of a package revision that already exists. In this scenario, Porch should throw an error and not allow the duplicate package revision to be created.
Actual behavior
Porch allows the duplicate package revision to be created.
Information
Using kpt and Porch on 6e8b94a3.
Steps to reproduce the behavior
The simplest way to reproduce the issue is to create the same package twice using the kpt cli.
> kpt alpha rpkg init new-blueprint --repository=application-blueprints --revision=v1 -n default
application-blueprints-048c553b23ba2733c37c97ea6157e7c25f41f887 created
> kpt alpha rpkg propose application-blueprints-048c553b23ba2733c37c97ea6157e7c25f41f887 -n default
application-blueprints-048c553b23ba2733c37c97ea6157e7c25f41f887 proposed
> kpt alpha rpkg approve application-blueprints-048c553b23ba2733c37c97ea6157e7c25f41f887 -n default
application-blueprints-048c553b23ba2733c37c97ea6157e7c25f41f887 approved
> kubectl get packagerevisions | grep new-blueprint
application-blueprints-b0be4378eb098a4b0e873153ca5485065639852c new-blueprint main false Published application-blueprints
application-blueprints-048c553b23ba2733c37c97ea6157e7c25f41f887 new-blueprint v1 true Published application-blueprints
> kpt alpha rpkg init new-blueprint --repository=application-blueprints --revision=v1 -n default
application-blueprints-048c553b23ba2733c37c97ea6157e7c25f41f887 created
> kubectl get packagerevisions | grep new-blueprint
application-blueprints-b0be4378eb098a4b0e873153ca5485065639852c new-blueprint main false Published application-blueprints
application-blueprints-048c553b23ba2733c37c97ea6157e7c25f41f887 new-blueprint v1 false Draft application-blueprints
application-blueprints-048c553b23ba2733c37c97ea6157e7c25f41f887 new-blueprint v1 true Published application-blueprints
> kpt alpha rpkg get | grep new-blueprint
application-blueprints-b0be4378eb098a4b0e873153ca5485065639852c new-blueprint main false Published application-blueprints
application-blueprints-048c553b23ba2733c37c97ea6157e7c25f41f887 new-blueprint v1 false Draft application-blueprints
application-blueprints-048c553b23ba2733c37c97ea6157e7c25f41f887 new-blueprint v1 true Published application-blueprints
cc @johnbelamaric @mortent @natasha41575
Should I even need to include Revision when creating a PackageRevision? Or should Porch figure that out? We don't want people to skip numbers, either.
@natasha41575 This should be fixed with your recent PRs right?
This should be fixed with the changes to how revisions are assigned.