Skip to content

bug fix so that RCv2 Linux can download script file within a folder inside a container#71

Merged
alsanmsft merged 6 commits into
mainfrom
dev/anasanc/scriptinfolderfix
Jan 30, 2026
Merged

bug fix so that RCv2 Linux can download script file within a folder inside a container#71
alsanmsft merged 6 commits into
mainfrom
dev/anasanc/scriptinfolderfix

Conversation

@alsanmsft

Copy link
Copy Markdown
Collaborator

Problem:
Previously, RCv2 Linux wouldn't download the script file from a Storage Account if the script was in a folder inside a container. os.OpenFile(), which RCv2 linux used to create the local file for the script, does not support the creation of additional/nested directories. So a file like "dir1/file.txt" would fail to create and open.

Solution:
Instead of trying to re-create the nested directory structure of a file, we only create the file itself. For example, if targetDir is the name of the directory where we are downloading our scripts locally, and a file is stored in the container as, say, "containerName/dir1/file.txt", our final local file will not be "targetDir/dir1/file.txt", but rather targetDir/file.txt". This is the same if the file in the container was at "containerName/dir1/dir2/foo.sh". It would end up locally at targetDir/foo.sh"

Related issues/links:
https://dev.azure.com/msazure/One/_workitems/edit/30049776/
#9
https://portal.microsofticm.com/imp/v5/incidents/details/559372230/summary

Comment thread pkg/download/blob.go Outdated
Comment thread pkg/download/blob.go
Comment thread pkg/download/blob_test.go
Add error handling for empty trimmed path in URL
Removed redundant check for empty splitStrings before extracting fileName.
Added prerequisites for running Test_GetSASBlob_nestedDirectories_actualBlob.
@alsanmsft alsanmsft merged commit 9755d1d into main Jan 30, 2026
5 checks passed
@norakoiralamsft norakoiralamsft mentioned this pull request Apr 3, 2026
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.

4 participants