[data] Skip unsupported file types with warning#337
Open
Conversation
Signed-off-by: Konstantin Kozoriz <konstantin.kozoriz@flant.com>
Signed-off-by: Konstantin Kozoriz <konstantin.kozoriz@flant.com>
Signed-off-by: Konstantin Kozoriz <konstantin.kozoriz@flant.com>
kneumoin
previously approved these changes
Apr 21, 2026
| case itemTypeFile, itemTypeLink: | ||
| // downloadable, proceed below | ||
| default: | ||
| log.Warn("Skipping non-downloadable entry", slog.String("name", item.Name), slog.String("type", item.Type)) |
There was a problem hiding this comment.
log.Warn("Skipping unsupported entry during filesystem download", slog.String("path", item.Name), slog.String("type", item.Type)) ?
Signed-off-by: Konstantin Kozoriz <konstantin.kozoriz@flant.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
d8 data export downloadfails with ERROR and leaves an empty stale directoryon disk when a Filesystem volume contains Unix sockets, FIFOs, or other special
files.
Server side: data-exporter reported sockets/FIFOs as
"type":"dir"- fixedin a companion MR in
storage-volume-data-manager.Client side: the download loop had no handling for unknown item types, so a
socket arriving as
"dir"causedos.MkdirAll, a recursive GET that returned400 not a regular file, and the entire download aborting with ERROR.Fix
Replace
if item.Type == "dir"with an explicitswitch:"dir"→ mkdir + recurse"file","link"→ downloadWARN Skipping non-downloadable entry+ skipType strings extracted into named constants.
Tests
TestDownloadFilesystem_SocketInDirIsSkipped- client skips"other"entry,downloads regular files, makes no HTTP request for the socket.
TestDownloadFilesystem_RecursiveWithSocketsCompletes- deep tree with socketscompletes successfully, no socket artefacts on disk.
Before
After