-
Notifications
You must be signed in to change notification settings - Fork 440
fix(workspace): ignore unreadable directories when listing Dockerfiles #1764
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -455,7 +455,8 @@ func (ws *Workspace) ListDockerfiles() ([]string, error) { | |
| // Add sub-directories containing a Dockerfile one level below current directory. | ||
| subFiles, err := ws.fsUtils.ReadDir(wdFile.Name()) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("read directory: %w", err) | ||
| // swallow errors for unreadable directories | ||
| continue | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to update unit tests for this change?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are currently no unit tests reliant on it, apparently. I'll add one in my next PR.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It turns out that afero does not check permissions when opening files. See spf13/afero#150 for others complaining about this. |
||
| } | ||
| for _, f := range subFiles { | ||
| // NOTE: ignore directories in sub-directories. | ||
|
|
||
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.
Good catch!