Skip to content
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

[AKS] fix a bug in zip on windows #20832

Merged
merged 3 commits into from
Feb 3, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Aks/Aks/Commands/RunAzureRmAksCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ private string GetCommandContext()
{
foreach (string filepath in filesToAttach)
{
var relativePath = filepath.Replace(rootDirectory, "").Trim('/').Trim('\\');
var relativePath = filepath.Replace(rootDirectory, "").Replace('\\', '/').Trim('/');
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use System.IO.Path.DirectorySeparatorChar to meet separator definitions in different OSs? BTW, please add change log for your change.

Copy link
Contributor Author

@YanaXu YanaXu Feb 2, 2023

Choose a reason for hiding this comment

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

The changelog is updated. Can't update "/" to System.IO.Path.DirectorySeparatorChar because Zip Spec does not support "\" but only "/".

var memoryZipFile = archive.CreateEntry(relativePath);
var fileContent = File.ReadAllText(filepath);
using (var entryStream = memoryZipFile.Open())
Expand Down