kpt icon indicating copy to clipboard operation
kpt copied to clipboard

Registering an empty repo causes an errors for rkpg

Open johnbelamaric opened this issue 1 year ago • 2 comments

Expected behavior

An empty repo should be the same as an empty main branch.

Actual behavior

Porch and kpt alpha rkpg commands get confused if there is an empty repo:

jbelamaric@jbelamaric:~/proj/nephio-packages$ kpt alpha rpkg get
Error: branch "main" doesn't exist: reference not found 

Information

kpt 1.0.0-beta.18 Porch 0.0.7

Using CSR with workload identity (though likely it doesn't matter).

Steps to reproduce the behavior

Create and register an empty Git repository. Run kpt alpha rpkg get. The Porch UI shows errors as well.

johnbelamaric avatar Jul 20 '22 19:07 johnbelamaric

I created a main branch by pushing a README.md file to it, and now it's working.

johnbelamaric avatar Jul 20 '22 19:07 johnbelamaric

This is at least partly intended behavior as described in https://github.com/GoogleContainerTools/kpt/pull/3024. But while we don't want to end up creating the first branch through porch (which makes it the default branch in github), it doesn't seem necessary to error out when we are listing packages.

mortent avatar Jul 25 '22 19:07 mortent

This is fixed with https://github.com/GoogleContainerTools/kpt/pull/3472 and https://github.com/GoogleContainerTools/kpt/pull/3473

mortent avatar Aug 30 '22 04:08 mortent