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

Authentication issue::Unable to clone a directory/package from a private repo #671

Open liamfallon opened 2 months ago

liamfallon commented 2 months ago

Original issue URL: https://github.com/kptdev/kpt/issues/3934 Original issue user: https://github.com/Cbkhare Original issue created at: 2023-04-27T15:24:57Z Original issue last updated at: 2023-05-02T22:17:07Z Original issue body: I am trying to clone a directory/package from a private git repo which has been registered. While executing the clone command, I am getting the below authentication issue.

$   kpt alpha rpkg clone \
>   https://github.com/******/***********.git pkg-out \
>   --directory=/test-pkg-out \
>   --ref=main \
>   --repository=test-catalogue \
>   --namespace=test
Error: Internal error occurred: cannot clone Git repository: cannot fetch repository /: authentication required

Repo registration details

$ kpt alpha repo get  -A
NAME             TYPE   CONTENT   DEPLOYMENT   READY   ADDRESS
test-catalogue   git    Package   false        True    https://github.com/******/***********.git

Since it is a private repository, I have hidden some details above with *

Note:

Expected behaviour.

Original issue comments: Comment user: https://github.com/mortent Comment created at: 2023-04-29T21:22:14Z Comment last updated at: 2023-04-29T21:22:14Z Comment body: @Cbkhare Thanks for reporting this.

So Porch doesn't currently have support for doing git or oci-based clones from private repositories. We are open to contributions here, but it should probably start with a design proposal, as it is not obvious how it would work.

But if the repository you want to clone from is either a Porch repository, or has a structure that allows you to register it with Porch, you can do a clone where you reference the Kubernetes name of the PackageRevision rather than the git repository. This is the "package" option described in the documentation.