Open Cbkhare opened 1 year ago
Do you mind sharing what repos/packagerevisions you had registered when you ran into this issue, i.e. the output of kpt alpha rpkg get
and kpt alpha repo get
? If any of your packagerevisions are clones, could you also share how you created them?
While we should never panic, this issue is odd because it implies a malformed UpstreamLock
in the Kptfile (or one of our assumptions about ref formats was incorrect) and I'd like to understand how that happened.
Hi,
below are the requested details
$ kpt alpha repo get -A
NAME TYPE CONTENT DEPLOYMENT READY ADDRESS
test-catalogue git Package false True https://github.com/********/*********************.git
$ kpt alpha rpkg get -A
NAMESPACE NAME PACKAGE WORKSPACENAME REVISION LATEST LIFECYCLE REPOSITORY
test test-catalogue-233a4ca4388204556f5bceff99a9799d1a86ed1a test-pk2 v1 v1 true Published test-catalogue
test test-catalogue-7a25f33ed16f31e2df4cc29da9c34565848d81c4 test-pkg v1 main false Published test-catalogue
test test-catalogue-93b612f846d238c0ee3cae8441f2e924d07eeca1 test-pkg v1 v1 true Published test-catalogue
test test-catalogue-76dd1a835ac600377616d401ecb05323bf17f2a9 test-pkg-docker v1 v1 true Published test-catalogue
test test-catalogue-912d60e5385d7979399530e0c14ccde526622213 test-pkg-out/test-pkg-test v1 false Proposed test-catalogue
test test-catalogue-bbb48d4284bd16b74cd089314906ed3b2ea7ba45 test-pkg-out/test-pkg-test1 v1 false Draft test-catalogue
test test-catalogue-88eafbcb6d7b73c5d934ba48ef4031334983e1e0 test-pkg-test1 v1 false Draft test-catalogue
test test-catalogue-2495313e2ff74c68b606b9ec2c16e04a0a7efc6a test-pkg2 v1 main false Published test-catalogue
test test-catalogue-170e5f5a6ed89619f1a0aee50623e6f98b27ee02 test-pkg2-u v1 main false Published test-catalogue
test test-catalogue-9e4212ac5bce692e4f2744c5ff32136cb078fa27 test-pkg2-u1 v1 false Proposed test-catalogue
Some of the above packages are clone. Below is the command I used to clone one of the package, with the output
$ kpt alpha rpkg clone test-catalogue-7a25f33ed16f31e2df4cc29da9c34565848d81c4 test-pk2 --repository=test-catalogue --ref=v2 --namespace=test --directory=test-pkg
result was
NAMESPACE NAME PACKAGE WORKSPACENAME REVISION LATEST LIFECYCLE REPOSITORY
test test-catalogue-233a4ca4388204556f5bceff99a9799d1a86ed1a test-pk2 v1 false Draft test-catalogue
Hmmm... I'm not able to reproduce the issue. Here are the steps I followed:
$ kpt alpha repo reg https://github.com/natasha41575/blueprints.git -ndefault --repo-basic-username=natasha41575 --repo-basic-password=*** -ntest
$ kpt alpha repo get -ntest
NAME TYPE CONTENT DEPLOYMENT READY ADDRESS
blueprints git Package True https://github.com/natasha41575/blueprints.git
$ kpt alpha rpkg init test-pkg --workspace=v1 --repository=blueprints -ntest
blueprints-f09e7e39a212cd16f5abcbf8fec35099cbee266d created
$ kpt alpha rpkg clone blueprints-f09e7e39a212cd16f5abcbf8fec35099cbee266d -ntest --workspace=clone --repository=blueprints test-pkg-clone
blueprints-8c50f85abaa5d22110b7c826bcb77f8f33d39dbb created
$ kpt alpha rpkg clone blueprints-f09e7e39a212cd16f5abcbf8fec35099cbee266d test-pk2 --repository=blueprints --ref=v2 --namespace=test --directory=test-pkg
blueprints-07772b7fb702c1068c74e9345d820f758e446bb1 created
$ kpt alpha rpkg get -ntest
NAME PACKAGE WORKSPACENAME REVISION LATEST LIFECYCLE REPOSITORY
blueprints-07772b7fb702c1068c74e9345d820f758e446bb1 test-pk2 v1 false Draft blueprints
blueprints-f09e7e39a212cd16f5abcbf8fec35099cbee266d test-pkg v1 false Draft blueprints
blueprints-8c50f85abaa5d22110b7c826bcb77f8f33d39dbb test-pkg-clone clone false Draft blueprints
$ kpt alpha rpkg update --discover=downstream
All downstream packages are up to date.
$ kpt alpha rpkg update --discover=upstream
PACKAGE REVISION UPSTREAM REPOSITORY UPSTREAM UPDATES
blueprints-07772b7fb702c1068c74e9345d820f758e446bb1 blueprints No update available
blueprints-f09e7e39a212cd16f5abcbf8fec35099cbee266d No update available
blueprints-8c50f85abaa5d22110b7c826bcb77f8f33d39dbb blueprints No update available
Can you double check my above steps and let me know if there is anything differently that you did? Would you mind also sharing the Kptfiles of your packages? The upstreamLock.Git.Ref
in the Kptfile for cloned packages should be of the format drafts/pkg-name/workspace
or pkg-name/version
. If they are not, then porch won't know how to parse them, so I'm wondering if one of the commands you ran incorrectly wrote out an invalid upstreamLock.Git.Ref
. Please also let us know if you made any changes to the package outside of running kpt alpha rpkg/repo
commands. Also please let us know what version of kpt CLI you are using and what version of porch you have running?
I also created a PR here https://github.com/GoogleContainerTools/kpt/pull/3938 to error out instead of panic.
As a side note, I don't think the --ref=v2
does anything for your rpkg clone
command. I think this is only relevant if you are cloning directly with a git URL or from OCI.
Hi Natasha,
Thanks for checking this. Below are some pointers wrt to above comment of yours.
1) 2 of my Directory in the repository have the kptfiles with details as follows. I can see the ref is main
. This was a cloned package.
upstreamLock:
type: git
git:
repo: https://github.com/***********/*****************.git
directory: test-pkg
ref: main
commit: 4331f0d83c6aa9f98b5a51e6
2) I added some files in the Directory from the Github UI.
3) kpt version
~$ kpt version
1.0.0-beta.31
Ah I see, that would explain it. rpkg update --discover
doesn't handle clones from main
. That is definitely a bug and we should see if we can fix it.
I am trying to update my downstream packages, but the
kpt alpha rpkg update --discover=upstream
panics out with below stackfollowed the command instructions as per output of below command