-
Notifications
You must be signed in to change notification settings - Fork 786
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
Report ignorefile location when no content added #3576
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@aramcap PTAL |
@@ -110,6 +110,7 @@ symlink(subdir)" | |||
@test "bud with .dockerignore #2" { | |||
run_buildah 125 build -t testbud3 --signature-policy ${TESTSDIR}/policy.json ${TESTSDIR}/bud/dockerignore3 | |||
expect_output --substring 'error building.*"COPY test1.txt /upload/test1.txt".*no such file or directory' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test is failing as it can't find the file test1.txt
add.go
Outdated
if _, err := os.Stat(ignoreFile); err != nil { | ||
ignoreFile = "" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This guess could well be wrong if buildah add
's --ignorefile
flag is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no way to know at this level whether that happened. I would figure most likely, their would not have been an ignorefile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass the filename that's the source of the Excludes
list in as a field in the AddAndCopyOptions
, and if one is provided, include it in the error message?
308054a
to
916a01a
Compare
pkg/parse/parse.go
Outdated
} | ||
return "" | ||
} | ||
func ContainerIgnoreFile(path string, contextDir string) ([]string, string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The arguments here are in the reverse of the order in which I think its callers expect.
All kinds of test unhappiness @rhatdan |
Users have accidently had a .containerignore or .dockerignore file in their context directly which blocked all content. Currently we report that no globs matched, but do not identify where the globs came from. This change is an attempt to add this data to the error. Example: containers#3318 Signed-off-by: Daniel J Walsh <[email protected]>
LGTM |
LGTM |
Users have accidently had a .containerignore or .dockerignore
file in their context directly which blocked all content.
Currently we report that no globs matched, but do not
identify where the globs came from.
This change is an attempt to add this data to the error.
Example: #3318
Signed-off-by: Daniel J Walsh [email protected]
What type of PR is this?
What this PR does / why we need it:
How to verify it
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?