Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kpt pkg get fails when repo contains links #2408

Closed
aodinokov opened this issue Jul 20, 2021 · 3 comments · Fixed by #2515
Closed

kpt pkg get fails when repo contains links #2408

aodinokov opened this issue Jul 20, 2021 · 3 comments · Fixed by #2515
Assignees
Labels
area/pkg bug Something isn't working triaged Issue has been triaged by adding an `area/` label
Milestone

Comments

@aodinokov
Copy link

Expected behavior

The repo that contains links (to files or dirs) should be cloned without errors

Actual behavior

It fails, see steps to reproduce below

Information

kpt version:

$ kpt version
1.0.0-beta.2

Steps to reproduce the behavior

config dir is in fact a link to another directory:

$ kpt pkg get https://github.com/airshipit/images/image-builder
Package "image-builder":
Fetching https://github.com/airshipit/images@master
From https://github.com/airshipit/images
 * branch            master     -> FETCH_HEAD
Error: error copying package: read /home/ubuntu/.kpt/repos/nb2hi4dthixs6z3joruhkyromnxw2l3bnfzhg2djobuxil3jnvqwozlt2qoyzwmpaczaj2mabgmoz6ccpy======/image-builder/config: is a directory

Apparently CopyDir can't handle links in its current implementation.

@aodinokov aodinokov added the bug Something isn't working label Jul 20, 2021
@droot
Copy link
Contributor

droot commented Jul 21, 2021

@aodinokov Yes, this is a known issue. kpt doesn't handle links well in various workflow not just packaging.

@droot droot added triaged Issue has been triaged by adding an `area/` label area/pkg labels Jul 21, 2021
airshipbot pushed a commit to airshipit/image-builder that referenced this issue Aug 4, 2021
A symlink was provided after the directory change from "config" to
"manifests", however this is no longer needed.

This also works around a kpt bug, which fails to clone repos that
contain symlinks. [1]

[1] kptdev/kpt#2408

Change-Id: I3856e5a9bd3839bfa7e98cd6bf4f32f77a23ffae
@zijianjoy
Copy link

+1 on getting this error.

@zijianjoy
Copy link

My use case is a bit different:

I ran the following command:

kpt pkg get "https://github.com/argoproj/argo-workflows.git/manifests@v3.1.6" upstream

When in kpt 0.39, this command ran successfully. But when in kpt 1.0.0+, the command fails with:


Package "manifests":
Fetching https://github.com/argoproj/argo-workflows@v3.1.6
From https://github.com/argoproj/argo-workflows
 * tag               v3.1.6     -> FETCH_HEAD
Error: error copying package: read /Users/jamxl/.kpt/repos/nb2hi4dthixs6z3joruhkyromnxw2l3bojtw64dsn5vc6ylsm5xs253pojvwm3dpo5z5ihmm3ghqbmqe5gaatghm7bbh4===/docs/examples: is a directory 

Note that I only need the files in manifests/ folder, but the error is about symlink examples in a separate folder docs. I think this error is avoidable as long as kpt 1.0.0+ doesn't copy the whole repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/pkg bug Something isn't working triaged Issue has been triaged by adding an `area/` label
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants