-
Notifications
You must be signed in to change notification settings - Fork 4k
[AzureRT] December release #3263
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
Add VmId to PS VM object. Remove-AzureRmVMNetworkInterface and Remove-AzureRmVMDataDisk removes all if NetworkInterfaceIDs and DataDiskNames parameters are not given, respectively.
@@ -42,6 +42,7 @@ public class RemoveAzureRmContainerServiceAgentPoolProfileCommand : Microsoft.Az | |||
[Parameter( | |||
Mandatory = true, | |||
Position = 1, | |||
ParameterSetName = "NameParameterSet", |
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.
@hyonholee why was this parameter set added?
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.
We generated these cmdlets. For Removing there are can be more than one way to removing (for example, removing with a name and removing with a id), so we added parameter set name for each removing way.
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.
If this is concerned, I will update our generator and remove parameter set when there is only one way to remove.
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.
I was just wondering why it was added. As long as the scenario where only the ContainerService
parameter is provided is covered, this will be fine
@@ -42,9 +42,17 @@ public class RemoveAzureRmVmssExtensionCommand : Microsoft.Azure.Commands.Resour | |||
[Parameter( | |||
Mandatory = true, | |||
Position = 1, | |||
ParameterSetName = "NameParameterSet", |
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.
@hyonholee same comment about parameter set
@@ -42,9 +42,17 @@ public class RemoveAzureRmVmssNetworkInterfaceConfigurationCommand : Microsoft.A | |||
[Parameter( | |||
Mandatory = true, | |||
Position = 1, | |||
ParameterSetName = "NameParameterSet", |
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.
@hyonholee same question about parameter set
@@ -88,34 +91,7 @@ public string ResourceGroupName | |||
// Gets or sets the storage profile. | |||
public StorageProfile StorageProfile { get; set; } | |||
|
|||
[JsonIgnore] |
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.
@hyonholee why were these properties removed?
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.
This is unnecessary. This property is just a copy of a nested property, which was used for piping scenario, but now the piping scenario works without these properties. There was a complain about these redundant property.
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.
There are numerous cmdlets that output an object of type PSVirtualMachine
, and existing scripts that use this object will no longer be able to use these properties, which means it's a breaking change.
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 we announce the breaking change? Do you think it is serious? These properties are not included in the VM response at the top level. They are nested properties and we added these redundant properties at the top level just for pipeline.
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.
@hyonholee Not sure this release is setup to be a breaking change. Can we leave this in the object until next time we have a breaking change release?
@cormacpayne What do we need to do for a breaking change release?
Position = 1, | ||
ValueFromPipelineByPropertyName = true, |
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.
@hyonholee why did you remove this attribute? Scripts that get DataDiskNames
from the pipeline will no longer work
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.
Pipeline works because I also updated Remove-AzureRmVMDataDisk. Please look at Test-VirtualMachineProfile test.
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.
Actually there is an issue with pipeline with Remove-AzureRmVMDataDisk (and other Remove command that removes a property from VM object.) Since this parameteter (DataDiskNames) have an alias "Name" and VM object has "Name" property for VM Name, in piping scenario (e.g. Get-AzureRmVM | Remove-AzureRmVMDataDisk ), VM name is piped to Remove-AzureRmVMDataDisk as a data disk name, and it tries to remove a data disk named VM name. Setting ValueFromPipelineByPropertyName to false removes this issue. Also we remove "DataDiskNames" (which is redundant property) from VM object, DataDiskNames are not piped from VM object to Remove-AzureRmVM. Remove-AzureRmVM is also modified when DataDiskNames are not provided, it interprets it as removing all existing data disks. So the command does not change the behavior of Get-AzureRmVM | Remove-AzureRmVM .
Position = 1, | ||
ValueFromPipelineByPropertyName = true, |
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.
@hyonholee same comment about removing this attribute
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 issue with Remove-AzureRmVMDataDisk
ProfileNouns.VaultSecretGroup), | ||
OutputType( | ||
typeof(PSVirtualMachine))] | ||
public class RemoveAzureVMSecretCommand : Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet |
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.
@hyonholee since this cmdlet makes changes, it should implement SupportsShouldProcess
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.
This cmdlet only updates a local VM object and does not actually remove the secret from VM, until Update-AzureRmVM is performed with the updated VM object. Other Remove cmdlets that change only local object do not have ShouldProcess or Force parameter
@hyonholee the build is failing because there is no help for the new cmdlet |
I will update the help file. Thanks for comments. |
…NetworkInterface and Remove-AzureRmVMDataDisk cmdlets
LGTM once on demand build passes http://azuresdkci.cloudapp.net/view/1-AzurePowerShell/job/powershell-demand/1343/ |
Description
This checklist is used to make sure that common guidelines for a pull request are followed. You can find a more complete discussion of PowerShell cmdlet best practices here.
General Guidelines
Testing Guidelines
Cmdlet Signature Guidelines
ShouldProcess
and haveSupportShouldProcess=true
specified in the cmdlet attribute. You can find more information onShouldProcess
here.OutputType
attribute if any output is produced - if the cmdlet produces no output, it should implement aPassThrough
parameter.Cmdlet Parameter Guidelines