Skip to content

Commit

Permalink
Update Windows install script for Get-PlatformType
Browse files Browse the repository at this point in the history
  • Loading branch information
song-jiang committed Oct 21, 2020
1 parent 5f3b2e0 commit fa08a74
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/install-calico-windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function GetPlatformType()
# AKS
$hnsNetwork = Get-HnsNetwork | ? Name -EQ azure
if ($hnsNetwork.name -EQ "azure") {
return ("azure")
return ("aks")
}

# EKS
Expand All @@ -115,8 +115,13 @@ function GetPlatformType()
}

# EC2
$awsNodeName = Invoke-RestMethod -uri http://169.254.169.254/latest/meta-data/local-hostname -ErrorAction Ignore
if (-Not [string]::IsNullOrEmpty($awsNodeName)) {
$restError = $null
Try {
$awsNodeName=Invoke-RestMethod -uri http://169.254.169.254/latest/meta-data/local-hostname -ErrorAction Ignore
} Catch {
$restError = $_
}
if ($restError -eq $null) {
return ("ec2")
}

Expand Down

0 comments on commit fa08a74

Please sign in to comment.