File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
src/ResourceManager/AzureBackup/Commands.AzureBackup/Cmdlets/Container Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,17 @@ public override void ExecuteCmdlet()
82
82
private List < AzureBackupContainer > GetMachineContainers ( )
83
83
{
84
84
List < MarsContainerResponse > marsContainerResponses = new List < MarsContainerResponse > ( ) ;
85
+
86
+ // Machine containers are always registered.
87
+ // So if requested Status is not Registered, return an empty list.
88
+ // Machine containers don't have a resource group.
89
+ // So, if a resource group is passed, return an empty list.
90
+ if ( Status != AzureBackupContainerRegistrationStatus . Registered ||
91
+ ! string . IsNullOrEmpty ( ManagedResourceGroupName ) )
92
+ {
93
+ return new List < AzureBackupContainer > ( ) ;
94
+ }
95
+
85
96
if ( string . IsNullOrEmpty ( Name ) )
86
97
{
87
98
marsContainerResponses . AddRange ( AzureBackupClient . ListMachineContainers ( ) ) ;
You can’t perform that action at this time.
0 commit comments