-
Notifications
You must be signed in to change notification settings - Fork 4k
[Storage] Support preserverPerserve File Attributes #10006
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
Conversation
5343999
to
1892e0a
Compare
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.
A few inline comments
@@ -201,7 +202,8 @@ public override void ExecuteCmdlet() | |||
targetFile, | |||
new DownloadOptions | |||
{ | |||
DisableContentMD5Validation = !this.CheckMd5 | |||
DisableContentMD5Validation = !this.CheckMd5, | |||
PreserveSMBAttributes = context.PreserveSMBAttribute.IsPresent ? true : false |
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.
PreserveSMBAttributes = context.PreserveSMBAttribute.IsPresent
is just fine
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.
Fixed.
@@ -221,5 +223,15 @@ public override void ExecuteCmdlet() | |||
DoEndProcessing(); | |||
} | |||
} | |||
public object GetDynamicParameters() | |||
{ | |||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) |
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.
Why not use
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) | |
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) |
if the parameters are only targeting on Windows?
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.
Yes, only on windows.
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.
Yes, this is required - you don't want to try to allow this on Mac OS
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.
Fixed.
@@ -221,5 +223,15 @@ public override void ExecuteCmdlet() | |||
DoEndProcessing(); | |||
} | |||
} | |||
public object GetDynamicParameters() | |||
{ | |||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) |
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.
Yes, this is required - you don't want to try to allow this on Mac OS
|
||
public object GetDynamicParameters() | ||
{ | ||
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) |
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.
Same comment as above, we need to be specific about Windows
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.
Fixed.
null, | ||
new UploadOptions | ||
{ | ||
PreserveSMBAttributes = context.PreserveSMBAttribute.IsPresent ? true : false |
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.
Can context be null here?
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 point. Fixed. And tested it works both on windows & Linux.
@@ -201,7 +202,8 @@ public override void ExecuteCmdlet() | |||
targetFile, | |||
new DownloadOptions | |||
{ | |||
DisableContentMD5Validation = !this.CheckMd5 | |||
DisableContentMD5Validation = !this.CheckMd5, | |||
PreserveSMBAttributes = context.PreserveSMBAttribute.IsPresent ? true : false |
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.
can context be null here?
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 point. Fixed. And tested it works both on windows & Linux.
@markcowl |
Description
This is to support preserver File SMB attributes when upload/download Azure File.
The design has pass review as part of https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/370
Checklist
CONTRIBUTING.md
ChangeLog.md
file(s) has been updated:ChangeLog.md
file can be found atsrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
## Upcoming Release
header -- no new version header should be added