kpt
kpt copied to clipboard
Registering an empty repo causes an errors for rkpg
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.
I created a main branch by pushing a README.md file to it, and now it's working.
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.
This is fixed with https://github.com/GoogleContainerTools/kpt/pull/3472 and https://github.com/GoogleContainerTools/kpt/pull/3473