Skip to content

check secret target is an absolute windows path#10819

Merged
glours merged 1 commit intodocker:v2from
ndeloof:windows_abs
Jul 19, 2023
Merged

check secret target is an absolute windows path#10819
glours merged 1 commit intodocker:v2from
ndeloof:windows_abs

Conversation

@ndeloof
Copy link
Copy Markdown
Contributor

@ndeloof ndeloof commented Jul 18, 2023

What I did
As we check secret target is absolute, we need to consider both unix and windows absolute path syntaxes
we could be more deterministic relying on image platform to only run the relevant code, but doesn't seem there are major risks for confusion

Related issue
fixes #10817

(not mandatory) A picture of a cute animal, if possible in relation to what you did

@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 18, 2023

Codecov Report

Patch coverage: 67.50% and project coverage change: +0.12 🎉

Comparison is base (5a072b1) 59.42% compared to head (47778f8) 59.55%.

Additional details and impacted files
@@            Coverage Diff             @@
##               v2   #10819      +/-   ##
==========================================
+ Coverage   59.42%   59.55%   +0.12%     
==========================================
  Files         115      115              
  Lines        9896     9909      +13     
==========================================
+ Hits         5881     5901      +20     
+ Misses       3426     3414      -12     
- Partials      589      594       +5     
Impacted Files Coverage Δ
cmd/compose/config.go 33.54% <0.00%> (+0.61%) ⬆️
pkg/api/api.go 42.30% <ø> (-1.09%) ⬇️
pkg/compose/secrets.go 63.07% <0.00%> (ø)
pkg/compose/pull.go 75.62% <33.33%> (-1.11%) ⬇️
pkg/compose/create.go 58.99% <41.66%> (-0.50%) ⬇️
pkg/compose/build.go 74.43% <100.00%> (+0.89%) ⬆️
pkg/compose/build_classic.go 52.56% <100.00%> (+0.30%) ⬆️
pkg/compose/viz.go 100.00% <100.00%> (ø)

... 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.

Copy link
Copy Markdown
Contributor

@milas milas left a comment

Choose a reason for hiding this comment

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

We do have a version of this that looks like it might be slightly more robust in compose-go already: https://github.com/compose-spec/compose-go/blob/95ac1be8bfdc4dc21cdfb14e37b52c31275046a3/loader/windows_path.go#L32-L43

(and it has test coverage 😉)

I think we should export & clean up the naming (s/isAbs/IsWindowsAbs/) from compose-go and switch to them here, but this should unblock all but the most pathological cases so LGTM 👍🏻

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.

[BUG] Secrets on Windows Container mounted through Linux path

3 participants