forked from Azure/azure-powershell
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate ConnectedKubernetes from generation to main (Azure#26128)
* Move ConnectedKubernetes to main * Add changelog and suppress the signature error --------- Co-authored-by: azure-powershell-bot <[email protected]> Co-authored-by: Lei jin <[email protected]>
- Loading branch information
1 parent
dc9bfed
commit 7c9a9fb
Showing
187 changed files
with
18,477 additions
and
2,414 deletions.
There are no files selected for viewing
366 changes: 338 additions & 28 deletions
366
src/ConnectedKubernetes/ConnectedKubernetes.Autorest/Az.ConnectedKubernetes.format.ps1xml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...tedKubernetes/ConnectedKubernetes.Autorest/UX/Microsoft.Kubernetes/connectedClusters.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
552 changes: 374 additions & 178 deletions
552
src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/New-AzConnectedKubernetes.ps1
Large diffs are not rendered by default.
Oops, something went wrong.
786 changes: 786 additions & 0 deletions
786
src/ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/Set-AzConnectedKubernetes.ps1
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...ConnectedKubernetes/ConnectedKubernetes.Autorest/custom/helpers/AzCloudMetadataHelper.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', '', | ||
Justification = 'MetaData is a recognised term', Scope = 'Function', Target = 'Get-AzCloudMetaData')] | ||
param() | ||
|
||
function Get-AZCloudMetadataResourceId { | ||
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.DoNotExport()] | ||
param ( | ||
[Parameter(Mandatory = $true)] | ||
[PSCustomObject]$cloudMetadata | ||
) | ||
|
||
# Search the $armMetadata hash for the entry where the "name" parameter matches | ||
# $cloud and then find the login endpoint, from which we can discern the | ||
# appropriate "cloud based domain ending". | ||
Write-Debug -Message "cloudMetaData in: $($cloudMetaData | ConvertTo-Json -Depth 10)." | ||
return $cloudMetadata.ResourceManagerUrl | ||
} | ||
|
||
Function Get-AzCloudMetadata { | ||
# The current cloud in use is set by the user so query it and then we can use | ||
# it to index into the ARM Metadata. | ||
$context = $null | ||
try { | ||
$context = Get-AzContext | ||
} | ||
catch { | ||
throw "Failed to get the current Azure context. Error: $_" | ||
} | ||
$cloudName = $context.Environment.Name | ||
|
||
try { | ||
# $Response = Invoke-RestMethod -Uri $MetadataEndpoint -Method Get -StatusCodeVariable StatusCode | ||
$cloud = Get-AzureEnvironment -Name $cloudName | ||
} | ||
catch { | ||
Write-Error "Failed to request ARM metadata. Error: $_" | ||
} | ||
Write-Debug -Message "cloudMetaData out: $($cloud | ConvertTo-Json -Depth 10)." | ||
|
||
return $cloud | ||
} |
Oops, something went wrong.