nephio-project / nephio

Nephio is a Kubernetes-based automation platform for deploying and managing highly distributed, interconnected workloads such as 5G Network Functions, and the underlying infrastructure on which those workloads depend.
Apache License 2.0
93 stars 52 forks source link

`kpt alpha rpkg copy` fails when package's upstream repository is unregistered #636

Closed liamfallon closed 1 week ago

liamfallon commented 2 months ago

Original issue URL: https://github.com/kptdev/kpt/issues/3534 Original issue user: https://github.com/ChristopherFry Original issue created at: 2022-09-01T23:00:15Z Original issue last updated at: 2022-11-15T22:19:31Z Original issue body: ### Expected behavior You should always be able to create a new revision of a package using kpt alpha rpkg copy even if the package's upstream repository is unregistered.

Actual behavior

kpt alpha rpkg copy fails with Error: Internal error occurred: failed to fetch package revision ... cannot find repository ...

Information

Kpt and Porch are both on 1d3a99cb.

Steps to Reproduce

In Porch, register two repositories - the public kpt-samples repository repository and a second personal repository

  1. Using kpt alpha rpkg clone, clone the echo/v1 package to your personal repository
  2. Using kpt alpha rpkg propose and kpt alpha rpkg approve approve the package
  3. Unregister the kpt-samples repostiory
  4. Using kpt alpha rpkg copy, create a new revision of the package
  5. Error occurs with above command
    Error: Internal error occurred: failed to fetch package revision "kpt-samples-3cecbbbc68286534bf31a98b7ac7fa3de911f84a": cannot find repository default/kpt-samples: repositories.config.porch.kpt.dev "kpt-samples" not found 

Original issue comments:

liamfallon commented 1 week ago

I tested this using the steps above and this bug no longer exists, the copy command worked fine on porchctl even with the original upstream repo/packages removed