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

fix: fail when path is not a directory for peercontainer upload/download #1028

Merged
merged 1 commit into from
May 29, 2023

Conversation

kmehant
Copy link
Member

@kmehant kmehant commented Apr 25, 2023

Signed-off-by: Mehant Kammakomati [email protected]

@github-actions
Copy link

Thanks for making a pull request! 😃
One of the maintainers will review and advise on the next steps.

@github-actions github-actions bot added the fix label Apr 25, 2023
@kmehant
Copy link
Member Author

kmehant commented May 26, 2023

@seshapad
@ashokponkumar please review!

@codecov
Copy link

codecov bot commented May 26, 2023

Codecov Report

Patch coverage: 20.00% and project coverage change: -0.05 ⚠️

Comparison is base (f809f33) 15.90% compared to head (8882f5a) 15.85%.

❗ Current head 8882f5a differs from pull request most recent head 182c6cf. Consider uploading reports for the commit 182c6cf to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1028      +/-   ##
==========================================
- Coverage   15.90%   15.85%   -0.05%     
==========================================
  Files          81       79       -2     
  Lines        7395     7196     -199     
==========================================
- Hits         1176     1141      -35     
+ Misses       5918     5762     -156     
+ Partials      301      293       -8     
Impacted Files Coverage Δ
environment/peercontainer.go 40.74% <20.00%> (-2.12%) ⬇️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

return path, fmt.Errorf("failed to stat the given path : %s. Error: %v", path, err)
}
if !fileInfo.IsDir() {
return path, fmt.Errorf("download only supports directory paths. The path provided is %s. Error: %v", path, err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to support only directories? Or is our current implementation support only directories?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashokponkumar From what I understand, I think it is for directories as of now. If you see the containerized transformer code, we actually create a tmp folder to upload the input json.

Having the upload and download path to include files would be a good flexibility to have.

Comment on lines +200 to +201
if !fileInfo.IsDir() {
return envpath, fmt.Errorf("upload only supports directory paths. The path provided is %s. Error: %v", outpath, err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashokponkumar would it be a good idea to support files as well as directories? Right now, this PR just raises an error if files are passed to upload.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@seshapad seshapad merged commit f3b48c3 into konveyor:main May 29, 2023
@kmehant kmehant deleted the fix-upload branch May 29, 2023 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants