Skip to content

Commit a137c3f

Browse files
wyunchi-msVeryEarlydingmeng-xue
authored
[ConnectedKubernetes] Update api-version of ConnectedKubernetes to 2021-03-01 (#14277)
* Update api-version of ConnectedKubernetes to 2021-03-01 * Update api-version of ConnectedKubernetes to 2021-03-01 * Update build.proj * Update build.proj * Update build.proj Co-authored-by: wyunchi-ms <[email protected]> Co-authored-by: Yabo Hu <[email protected]> Co-authored-by: Dingmeng Xue <[email protected]>
1 parent 71de355 commit a137c3f

File tree

143 files changed

+4470
-3209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+4470
-3209
lines changed

src/ConnectedKubernetes/Az.ConnectedKubernetes.format.ps1xml

Lines changed: 174 additions & 136 deletions
Large diffs are not rendered by default.
Lines changed: 130 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,133 @@
1+
#
2+
# Module manifest for module 'Az.ConnectedKubernetes'
3+
#
4+
# Generated by: Microsoft Corporation
5+
#
6+
# Generated on: 2021-02-23
7+
#
8+
19
@{
2-
GUID = '59df8ab1-442a-41ae-9b55-60b505bae789'
3-
RootModule = './Az.ConnectedKubernetes.psm1'
4-
ModuleVersion = '0.1.0'
5-
CompatiblePSEditions = 'Core', 'Desktop'
6-
Author = 'Microsoft Corporation'
7-
CompanyName = 'Microsoft Corporation'
8-
Copyright = 'Microsoft Corporation. All rights reserved.'
9-
Description = 'Microsoft Azure PowerShell: ConnectedKubernetes cmdlets'
10-
PowerShellVersion = '5.1'
11-
DotNetFrameworkVersion = '4.7.2'
12-
RequiredAssemblies = './bin/Az.ConnectedKubernetes.private.dll'
13-
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.5'; })
14-
FormatsToProcess = './Az.ConnectedKubernetes.format.ps1xml'
15-
FunctionsToExport = 'Get-AzConnectedKubernetes', 'New-AzConnectedKubernetes', 'Remove-AzConnectedKubernetes', 'Update-AzConnectedKubernetes'
16-
AliasesToExport = '*'
17-
PrivateData = @{
10+
11+
# Script module or binary module file associated with this manifest.
12+
RootModule = './Az.ConnectedKubernetes.psm1'
13+
14+
# Version number of this module.
15+
ModuleVersion = '0.1.0'
16+
17+
# Supported PSEditions
18+
CompatiblePSEditions = 'Core', 'Desktop'
19+
20+
# ID used to uniquely identify this module
21+
GUID = '59df8ab1-442a-41ae-9b55-60b505bae789'
22+
23+
# Author of this module
24+
Author = 'Microsoft Corporation'
25+
26+
# Company or vendor of this module
27+
CompanyName = 'Microsoft Corporation'
28+
29+
# Copyright statement for this module
30+
Copyright = 'Microsoft Corporation. All rights reserved.'
31+
32+
# Description of the functionality provided by this module
33+
Description = 'Microsoft Azure PowerShell: ConnectedKubernetes cmdlets'
34+
35+
# Minimum version of the PowerShell engine required by this module
36+
PowerShellVersion = '5.1'
37+
38+
# Name of the PowerShell host required by this module
39+
# PowerShellHostName = ''
40+
41+
# Minimum version of the PowerShell host required by this module
42+
# PowerShellHostVersion = ''
43+
44+
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45+
DotNetFrameworkVersion = '4.7.2'
46+
47+
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48+
# ClrVersion = ''
49+
50+
# Processor architecture (None, X86, Amd64) required by this module
51+
# ProcessorArchitecture = ''
52+
53+
# Modules that must be imported into the global environment prior to importing this module
54+
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.5'; })
55+
56+
# Assemblies that must be loaded prior to importing this module
57+
RequiredAssemblies = './bin/Az.ConnectedKubernetes.private.dll'
58+
59+
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60+
# ScriptsToProcess = @()
61+
62+
# Type files (.ps1xml) to be loaded when importing this module
63+
# TypesToProcess = @()
64+
65+
# Format files (.ps1xml) to be loaded when importing this module
66+
FormatsToProcess = './Az.ConnectedKubernetes.format.ps1xml'
67+
68+
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69+
# NestedModules = @()
70+
71+
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
72+
FunctionsToExport = 'Get-AzConnectedKubernetes', 'New-AzConnectedKubernetes',
73+
'Remove-AzConnectedKubernetes', 'Update-AzConnectedKubernetes'
74+
75+
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
76+
CmdletsToExport = @()
77+
78+
# Variables to export from this module
79+
# VariablesToExport = @()
80+
81+
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
82+
AliasesToExport = '*'
83+
84+
# DSC resources to export from this module
85+
# DscResourcesToExport = @()
86+
87+
# List of all modules packaged with this module
88+
# ModuleList = @()
89+
90+
# List of all files packaged with this module
91+
# FileList = @()
92+
93+
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
94+
PrivateData = @{
95+
1896
PSData = @{
19-
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'ConnectedKubernetes'
20-
LicenseUri = 'https://aka.ms/azps-license'
21-
ProjectUri = 'https://github.com/Azure/azure-powershell'
22-
ReleaseNotes = '* the first preview release'
23-
}
24-
}
97+
98+
# Tags applied to this module. These help with module discovery in online galleries.
99+
Tags = 'Azure','ResourceManager','ARM','PSModule','ConnectedKubernetes'
100+
101+
# A URL to the license for this module.
102+
LicenseUri = 'https://aka.ms/azps-license'
103+
104+
# A URL to the main website for this project.
105+
ProjectUri = 'https://github.com/Azure/azure-powershell'
106+
107+
# A URL to an icon representing this module.
108+
# IconUri = ''
109+
110+
# ReleaseNotes of this module
111+
# ReleaseNotes = ''
112+
113+
# Prerelease string of this module
114+
# Prerelease = ''
115+
116+
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
117+
# RequireLicenseAcceptance = $false
118+
119+
# External dependent modules of this module
120+
# ExternalModuleDependencies = @()
121+
122+
} # End of PSData hashtable
123+
124+
} # End of PrivateData hashtable
125+
126+
# HelpInfo URI of this module
127+
# HelpInfoURI = ''
128+
129+
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
130+
# DefaultCommandPrefix = ''
131+
25132
}
133+

src/ConnectedKubernetes/Az.ConnectedKubernetes.psm1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@
2424
}
2525
}
2626
if(-not $accountsModule) {
27-
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'1.7.4' } | Measure-Object).Count -gt 0
27+
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'1.8.1' } | Measure-Object).Count -gt 0
2828
if($hasAdequateVersion) {
29-
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 1.7.4 -Scope Global -PassThru
29+
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 1.8.1 -Scope Global -PassThru
3030
}
3131
}
3232
}
3333

3434
if(-not $accountsModule) {
35-
Write-Error "`nThis module requires $accountsName version 1.7.4 or greater. For installation instructions, please see: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps" -ErrorAction Stop
36-
} elseif (($accountsModule.Version -lt [System.Version]'1.7.4') -and (-not $localAccounts)) {
37-
Write-Error "`nThis module requires $accountsName version 1.7.4 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to remove '.PSSharedModules' in your home directory. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
35+
Write-Error "`nThis module requires $accountsName version 1.8.1 or greater. For installation instructions, please see: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps" -ErrorAction Stop
36+
} elseif (($accountsModule.Version -lt [System.Version]'1.8.1') -and (-not $localAccounts)) {
37+
Write-Error "`nThis module requires $accountsName version 1.8.1 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to remove '.PSSharedModules' in your home directory. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
3838
}
3939
Write-Information "Loaded Module '$($accountsModule.Name)'"
4040

src/ConnectedKubernetes/ChangeLog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Updated api-version of ConnectedKubernetes to 2021-03-01
2122

2223
## Version 0.1.0
23-
* the first preview release
24+
* The first preview release
2425

src/ConnectedKubernetes/check-dependencies.ps1

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ if(-not $Isolated) {
2121
return
2222
}
2323

24-
function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum) {
24+
function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) {
2525
if($predicate) {
2626
$module = Get-Module -ListAvailable -Name $moduleName
2727
if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0)) {
2828
$null = New-Item -ItemType Directory -Force -Path $path
2929
Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..."
30-
if($versionMinimum) {
30+
if ($requiredVersion) {
31+
Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path
32+
}elseif($versionMinimum) {
3133
Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path
3234
} else {
3335
Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path
@@ -44,8 +46,8 @@ if(Test-Path -Path $localModulesPath) {
4446
$env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
4547
}
4648

47-
DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '1.7.4'
48-
DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -versionMinimum ''
49+
DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '1.8.1'
50+
DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1'
4951

5052
$tools = Join-Path $PSScriptRoot 'tools'
5153
$resourceDir = Join-Path $tools 'Resources'

src/ConnectedKubernetes/custom/Az.ConnectedKubernetes.custom.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# region Generated
22
# Load the private module dll
3-
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.ConnectedKubernetes.private.dll')
3+
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.ConnectedKubernetes.private.dll')
44

55
# Load the internal module
6-
$internalModulePath = Join-Path $PSScriptRoot '../internal/Az.ConnectedKubernetes.internal.psm1'
6+
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.ConnectedKubernetes.internal.psm1'
77
if(Test-Path $internalModulePath) {
88
$null = Import-Module -Name $internalModulePath
99
}

src/ConnectedKubernetes/custom/New-AzConnectedKubernetes.ps1

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ API to register a new K8s cluster and thereby create a tracked resource in ARM
2020
API to register a new K8s cluster and thereby create a tracked resource in ARM
2121
2222
.Outputs
23-
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api202001Preview.IConnectedCluster
23+
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20210301.IConnectedCluster
2424
.Link
25-
https://docs.microsoft.com/en-us/powershell/module/az.connectedkubernetes/new-azconnectedkubernetes
25+
https://docs.microsoft.com/powershell/module/az.connectedkubernetes/new-azconnectedkubernetes
2626
#>
2727
function New-AzConnectedKubernetes {
28-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api202001Preview.IConnectedCluster])]
28+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20210301.IConnectedCluster])]
2929
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
3030
param(
3131
[Parameter(Mandatory)]
@@ -145,12 +145,6 @@ function New-AzConnectedKubernetes {
145145
if ($PSBoundParameters.ContainsKey('SubscriptionId')) {
146146
$CommonPSBoundParameters['SubscriptionId'] = $SubscriptionId
147147
}
148-
$AadProfileClientAppId = ''
149-
$PSBoundParameters.Add('AadProfileClientAppId', $AadProfileClientAppId)
150-
$AadProfileServerAppId = ''
151-
$PSBoundParameters.Add('AadProfileServerAppId', $AadProfileServerAppId)
152-
$AadProfileTenantId = ''
153-
$PSBoundParameters.Add('AadProfileTenantId', $AadProfileTenantId)
154148
$IdentityType = [Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Support.ResourceIdentityType]::SystemAssigned
155149
$PSBoundParameters.Add('IdentityType', $IdentityType)
156150

@@ -244,7 +238,12 @@ function New-AzConnectedKubernetes {
244238
#Endregion
245239

246240
#Region export helm chart
247-
$ChartExportPath = Join-Path -Path (Get-Item Env:HOME).Value -ChildPath '.azure' | Join-Path -ChildPath 'AzureArcCharts'
241+
if (Test-Path Env:Home) {
242+
$ChartExportPath = Join-Path -Path (Get-Item Env:HOME).Value -ChildPath '.azure' | Join-Path -ChildPath 'AzureArcCharts'
243+
# $KubeConfig = Join-Path -Path $Env:Home -ChildPath '.kube' | Join-Path -ChildPath 'config'
244+
} else {
245+
$ChartExportPath = Join-Path -Path $Home -ChildPath '.azure' | Join-Path -ChildPath 'AzureArcCharts'
246+
}
248247
try {
249248
helm chart export $RegisteryPath --kubeconfig $KubeConfig --kube-context $KubeContext --destination $ChartExportPath
250249
} catch {

src/ConnectedKubernetes/custom/Remove-AzConnectedKubernetes.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ INPUTOBJECT <IConnectedKubernetesIdentity>: Identity Parameter
3434
[ResourceGroupName <String>]: The name of the resource group. The name is case insensitive.
3535
[SubscriptionId <String>]: The ID of the target subscription.
3636
.Link
37-
https://docs.microsoft.com/en-us/powershell/module/az.connectedkubernetes/remove-azconnectedkubernetes
37+
https://docs.microsoft.com/powershell/module/az.connectedkubernetes/remove-azconnectedkubernetes
3838
#>
3939
function Remove-AzConnectedKubernetes {
4040
[OutputType([System.Boolean])]

src/ConnectedKubernetes/custom/Update-AzConnectedKubernetes.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ API to update certain properties of the connected cluster resource.
2222
.Inputs
2323
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.IConnectedKubernetesIdentity
2424
.Outputs
25-
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api202001Preview.IConnectedCluster
25+
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20210301.IConnectedCluster
2626
.Notes
2727
COMPLEX PARAMETER PROPERTIES
2828
@@ -34,10 +34,10 @@ INPUTOBJECT <IConnectedKubernetesIdentity>: Identity Parameter
3434
[ResourceGroupName <String>]: The name of the resource group. The name is case insensitive.
3535
[SubscriptionId <String>]: The ID of the target subscription.
3636
.Link
37-
https://docs.microsoft.com/en-us/powershell/module/az.connectedkubernetes/update-azconnectedkubernetes
37+
https://docs.microsoft.com/powershell/module/az.connectedkubernetes/update-azconnectedkubernetes
3838
#>
3939
function Update-AzConnectedKubernetes {
40-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api202001Preview.IConnectedCluster])]
40+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20210301.IConnectedCluster])]
4141
[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
4242
param(
4343
[Parameter(ParameterSetName='UpdateExpanded', Mandatory)]
@@ -70,7 +70,7 @@ param(
7070

7171
[Parameter()]
7272
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Category('Body')]
73-
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api202001Preview.IConnectedClusterPatchTags]))]
73+
[Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20210301.IConnectedClusterPatchTags]))]
7474
[System.Collections.Hashtable]
7575
# Resource tags.
7676
${Tag},

src/ConnectedKubernetes/exports/Get-AzConnectedKubernetes.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ eastus connected-pwsh-aks Microsoft.Kubernetes/connectedClusters
5555
.Inputs
5656
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.IConnectedKubernetesIdentity
5757
.Outputs
58-
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api202001Preview.IConnectedCluster
58+
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20210301.IConnectedCluster
5959
.Notes
6060
COMPLEX PARAMETER PROPERTIES
6161
@@ -67,10 +67,10 @@ INPUTOBJECT <IConnectedKubernetesIdentity>: Identity Parameter
6767
[ResourceGroupName <String>]: The name of the resource group. The name is case insensitive.
6868
[SubscriptionId <String>]: The ID of the target subscription.
6969
.Link
70-
https://docs.microsoft.com/en-us/powershell/module/az.connectedkubernetes/get-azconnectedkubernetes
70+
https://docs.microsoft.com/powershell/module/az.connectedkubernetes/get-azconnectedkubernetes
7171
#>
7272
function Get-AzConnectedKubernetes {
73-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api202001Preview.IConnectedCluster])]
73+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20210301.IConnectedCluster])]
7474
[CmdletBinding(DefaultParameterSetName='List1', PositionalBinding=$false)]
7575
param(
7676
[Parameter(ParameterSetName='Get', Mandatory)]

src/ConnectedKubernetes/exports/New-AzConnectedKubernetes.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ Location Name Type
3131
eastus ps-connaks-t02 Microsoft.Kubernetes/connectedClusters
3232
3333
.Outputs
34-
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api202001Preview.IConnectedCluster
34+
Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20210301.IConnectedCluster
3535
.Link
36-
https://docs.microsoft.com/en-us/powershell/module/az.connectedkubernetes/new-azconnectedkubernetes
36+
https://docs.microsoft.com/powershell/module/az.connectedkubernetes/new-azconnectedkubernetes
3737
#>
3838
function New-AzConnectedKubernetes {
39-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api202001Preview.IConnectedCluster])]
39+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ConnectedKubernetes.Models.Api20210301.IConnectedCluster])]
4040
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
4141
param(
4242
[Parameter(Mandatory)]

0 commit comments

Comments
 (0)