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

Check if the copy file source is absolute #261

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sudhackar
Copy link
Member

From the mm discussion
https://github.com/canonical/ubuntu-image/blob/main/internal/imagedefinition/README.rst

    copy-file: (optional)
      -
        # The path to the file to copy.
        # The given path will be interpreted as relative to the
        # path of the image definition file if is not absolute.
        source: <string>

mentions

if is not absolute

but the code actually never checks that the path is absolute or not and always use it relative
from :

source := filepath.Join(confDefPath, c.Source)
dest := filepath.Join(targetDir, c.Dest)
if debug {

Simple PR that fixes this.

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

Attention: Patch coverage is 25.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 83.77%. Comparing base (bb3a3fe) to head (0830a68).
Report is 26 commits behind head on main.

Files with missing lines Patch % Lines
internal/statemachine/helper.go 25.00% 2 Missing and 1 partial ⚠️

❗ There is a different number of reports uploaded between BASE (bb3a3fe) and HEAD (0830a68). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (bb3a3fe) HEAD (0830a68)
unittests 2 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #261       +/-   ##
===========================================
- Coverage   93.96%   83.77%   -10.20%     
===========================================
  Files          18       18               
  Lines        3429     4375      +946     
===========================================
+ Hits         3222     3665      +443     
- Misses        133      632      +499     
- Partials       74       78        +4     
Flag Coverage Δ
unittests 83.77% <25.00%> (-10.20%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant