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

porch: restrict clone and init to only create the first package revision #3603

Merged
merged 5 commits into from
Oct 18, 2022

Conversation

natasha41575
Copy link
Contributor

@natasha41575 natasha41575 commented Oct 6, 2022

Partially implements #3467 (comment)

Only the first package revision can be made by init or clone. Subsequent package revisions should be created with edit/copy.

This adds the check on both the CLI and server side.

@natasha41575 natasha41575 changed the title only the first package revision can be made by clone or init porch CLI: restrict clone and init to only create the first package revision Oct 6, 2022
@natasha41575
Copy link
Contributor Author

cc @mortent @justinsb

@natasha41575 natasha41575 force-pushed the cloneInitRestrictions branch 3 times, most recently from dee08cc to 442c310 Compare October 7, 2022 16:30
@natasha41575
Copy link
Contributor Author

cc @yuwenma

return err
}
for _, pr := range packageRevisionList.Items {
if pr.Spec.RepositoryName == r.repository && pr.Spec.PackageName == packageName {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we support fieldSelectors today, but if/when we get to CRDs we likely won't, so ... fine for now!

@justinsb
Copy link
Contributor

This seems fine, though possibly moot once we have workspaces (which I think you're working on in parallel).

If it helps you before workspaces, LGTM!

@natasha41575 natasha41575 force-pushed the cloneInitRestrictions branch 2 times, most recently from 5cd583b to ba12df0 Compare October 14, 2022 19:17
@natasha41575 natasha41575 changed the title porch CLI: restrict clone and init to only create the first package revision porch: restrict clone and init to only create the first package revision Oct 14, 2022
@natasha41575 natasha41575 force-pushed the cloneInitRestrictions branch 2 times, most recently from 82472a7 to 8699a13 Compare October 14, 2022 19:56
@natasha41575 natasha41575 force-pushed the cloneInitRestrictions branch 3 times, most recently from 6092fc7 to 0f6ccca Compare October 17, 2022 19:04
@natasha41575 natasha41575 force-pushed the cloneInitRestrictions branch from 0f6ccca to 3ed6d8e Compare October 17, 2022 20:02
@natasha41575 natasha41575 merged commit 1964f0a into kptdev:main Oct 18, 2022
@natasha41575 natasha41575 deleted the cloneInitRestrictions branch October 18, 2022 15:57
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.

5 participants