Skip to content

Commit

Permalink
fix: add exit for tanzu (#97)
Browse files Browse the repository at this point in the history
vSphere with Tanzu enabled workload domains are not currently supported by the module.  Added exit to `PowerManagement-WorkloadDomain.ps1` if detected. 

Signed-off-by: Jared Burns <jared.burns@broadcom.com>
  • Loading branch information
burnsjared0415 authored Feb 15, 2024
1 parent f1c77c2 commit 4cd152f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Bugfix:

- Added support to `PowerManagement-ManagmentDomain.ps1` and `PowerManagement-WorkloadDomain.ps1` for vSAN File Services to be excluded from customer virtual machines. [GH-95](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-power-management/pull/95)
- Added exit to Tanzu Code in `PowerManagement-WorkloadDomain.ps1`[GH-97](https://github.com/vmware/powershell-module-for-vmware-cloud-foundation-power-management/pull/97)

Enhancement:

Expand Down
3 changes: 1 addition & 2 deletions SampleScripts/PowerManagement-ManagementDomain.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,8 @@ if ($PsBoundParameters.ContainsKey("shutdown") -or $PsBoundParameters.ContainsKe
}

$status = Get-TanzuEnabledClusterStatus -server $vcServer.fqdn -user $vcUser -pass $vcPass -cluster $cluster.name

if ($status -eq $True) {
Write-PowerManagementLogMessage -Type ERROR -Message "Currently we are not supporting VMware Tanzu enabled domains. Please try on other workload domains."
Write-PowerManagementLogMessage -Type ERROR -Message "Currently we are not supporting VMware Tanzu enabled domains. Exiting..."
Exit
}

Expand Down
3 changes: 2 additions & 1 deletion SampleScripts/PowerManagement-WorkloadDomain.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,8 @@ Try {
# Check if Tanzu is enabled in WLD
$status = Get-TanzuEnabledClusterStatus -server $vcServer.fqdn -user $vcUser -pass $vcPass -cluster $cluster.name
if ($status -eq $True) {
Write-PowerManagementLogMessage -Type ERROR -Message "Currently workload domains with vSphere with Tanzu are not supported. Exiting."
Write-PowerManagementLogMessage -Type ERROR -Message "Currently workload domains with vSphere with Tanzu are not supported. Exiting..."
Exit
}

$clustervcfvms = @()
Expand Down
2 changes: 1 addition & 1 deletion VMware.CloudFoundation.PowerManagement.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
RootModule = 'VMware.CloudFoundation.PowerManagement.psm1'

# Version number of this module.
ModuleVersion = '1.4.1.1007'
ModuleVersion = '1.4.1.1008'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down

0 comments on commit 4cd152f

Please sign in to comment.