Skip to content

Commit 89c1a4d

Browse files
authored
[KubernetesConfiguration] Upgrade API version from 2019-11-01-preview to 2020-10-01-preview. (#13829)
* [KubernetesConfiguration] Upgrade API version from 2019-11-01-preview to 2020-10-01-preview. * [KubernetesConfiguration] Updated ChangeLog.md * [KubernetesConfiguration] update help doc.
1 parent 622bd3e commit 89c1a4d

File tree

125 files changed

+3525
-1741
lines changed

Some content is hidden

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

125 files changed

+3525
-1741
lines changed

src/KubernetesConfiguration/Az.KubernetesConfiguration.format.ps1xml

Lines changed: 182 additions & 24 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.KubernetesConfiguration'
3+
#
4+
# Generated by: Microsoft Corporation
5+
#
6+
# Generated on: 12/24/2020
7+
#
8+
19
@{
2-
GUID = '372af220-241d-455f-a85f-8be57ce75bb7'
3-
RootModule = './Az.KubernetesConfiguration.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: KubernetesConfiguration cmdlets'
10-
PowerShellVersion = '5.1'
11-
DotNetFrameworkVersion = '4.7.2'
12-
RequiredAssemblies = './bin/Az.KubernetesConfiguration.private.dll'
13-
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.2.2'; })
14-
FormatsToProcess = './Az.KubernetesConfiguration.format.ps1xml'
15-
FunctionsToExport = 'Get-AzKubernetesConfiguration', 'New-AzKubernetesConfiguration', 'Remove-AzKubernetesConfiguration'
16-
AliasesToExport = '*'
17-
PrivateData = @{
10+
11+
# Script module or binary module file associated with this manifest.
12+
RootModule = './Az.KubernetesConfiguration.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 = '372af220-241d-455f-a85f-8be57ce75bb7'
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: KubernetesConfiguration 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.2'; })
55+
56+
# Assemblies that must be loaded prior to importing this module
57+
RequiredAssemblies = './bin/Az.KubernetesConfiguration.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.KubernetesConfiguration.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-AzKubernetesConfiguration', 'New-AzKubernetesConfiguration',
73+
'Remove-AzKubernetesConfiguration'
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', 'KubernetesConfiguration'
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','KubernetesConfiguration'
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/KubernetesConfiguration/Az.KubernetesConfiguration.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/KubernetesConfiguration/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Upgrade API version from 2019-11-01-preview to 2020-10-01-preview.
2122

2223
## Version 0.1.0
2324
* the first preview release

src/KubernetesConfiguration/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/KubernetesConfiguration/custom/New-AzKubernetesConfiguration.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ Create a new Kubernetes Source Control Configuration.
1919
.Description
2020
Create a new Kubernetes Source Control Configuration.
2121
.Outputs
22-
Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Models.Api20191101Preview.ISourceControlConfiguration
22+
Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Models.Api20201001Preview.ISourceControlConfiguration
2323
.Link
24-
https://docs.microsoft.com/en-us/powershell/module/az.kubernetesconfiguration/new-azsourcecontrolconfiguration
24+
https://docs.microsoft.com/en-us/powershell/module/az.kubernetesconfiguration/new-azkubernetesconfiguration
2525
#>
2626
function New-AzKubernetesConfiguration {
27-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Models.Api20191101Preview.ISourceControlConfiguration])]
27+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Models.Api20201001Preview.ISourceControlConfiguration])]
2828
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
2929
param(
3030
[Parameter(Mandatory, HelpMessage="The name of the kubernetes cluster.")]
@@ -159,15 +159,15 @@ function New-AzKubernetesConfiguration {
159159
process {
160160

161161
if ($PSBoundParameters.ContainsKey('EnableHelmOperator')) {
162-
$PSBoundParameters.EnableHelmOperator = [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Support.EnableHelmOperator]::True
162+
$PSBoundParameters.EnableHelmOperator = [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Support.EnableHelmOperatorType]::True
163163
} else {
164-
$PSBoundParameters.EnableHelmOperator = [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Support.EnableHelmOperator]::False
164+
$PSBoundParameters.EnableHelmOperator = [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Support.EnableHelmOperatorType]::False
165165
}
166166

167167
if ($PSBoundParameters.ContainsKey('ClusterScoped')) {
168-
$PSBoundParameters.OperatorScope = [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Support.OperatorScope]::Cluster
168+
$PSBoundParameters.OperatorScope = [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Support.OperatorScopeType]::Cluster
169169
} else {
170-
$PSBoundParameters.OperatorScope = [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Support.OperatorScope]::Namespace
170+
$PSBoundParameters.OperatorScope = [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Support.OperatorScopeType]::Namespace
171171
}
172172

173173
if ($PSBoundParameters.ContainsKey('ClusterType')) {

src/KubernetesConfiguration/examples/Get-AzKubernetesConfiguration.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,45 @@
11
### Example 1: Get all configurations of kubernetes cluster
22
```powershell
3-
PS C:\> Get-AzKubernetesConfiguration -ResourceGroupName azureps-manual-test -ClusterName ps-connaks-t02 -ClusterRp Microsoft.Kubernetes -ClusterType ConnectedClusters
3+
PS C:\> Get-AzKubernetesConfiguration -ResourceGroupName azure-rg-test -ClusterName k8scluster-t01 -ClusterRp Microsoft.Kubernetes -ClusterType ConnectedClusters
44
5-
Name Type
6-
---- ----
7-
conf-test01 Microsoft.KubernetesConfiguration/sourceControlConfigurations
5+
Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType Type
6+
---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ---------------------------- ----
7+
k8sconfig-t02 12/21/2020 5:29:33 AM 12/21/2020 5:29:33 AM Microsoft.KubernetesConfiguration/so…
8+
k8sconfig-t01 12/21/2020 5:26:17 AM 12/21/2020 5:27:45 AM Microsoft.KubernetesConfiguration/so…
89
```
910

1011
This command gets all configurations of kubernetes cluster.
1112

1213
### Example 2: Get a configuration of kubernetes cluster by name
1314
```powershell
14-
PS C:\> Get-AzKubernetesConfiguration -ResourceGroupName azureps-manual-test -ClusterName ps-connaks-t02 -ClusterRp Microsoft.Kubernetes -ClusterType ConnectedClusters -Name conf-t02
15+
PS C:\> Get-AzKubernetesConfiguration -ResourceGroupName azure-rg-test -ClusterName k8scluster-t01 -ClusterRp Microsoft.Kubernetes -ClusterType ConnectedClusters -Name k8sconfig-t02
1516
16-
Name Type
17-
---- ----
18-
conf-t02 Microsoft.KubernetesConfiguration/sourceControlConfigurations
17+
Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType Type
18+
---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ---------------------------- ----
19+
k8sconfig-t02 12/21/2020 5:29:33 AM 12/21/2020 5:29:33 AM Microsoft.KubernetesConfiguration/so…
1920
```
2021

2122
This command gets a configuration of kubernetes cluster by name.
2223

2324
### Example 3: Get a configuration of kubernetes cluster by object
2425
```powershell
25-
PS C:\> $kubConf = New-AzKubernetesConfiguration -Name conf-test02 -ClusterName connaks-dkc29c -ResourceGroupName connaks-rg-w9vlnp -RepositoryUrl http://github.com/xxxx
26+
PS C:\> $kubConf = New-AzKubernetesConfiguration -Name k8sconfig-t02 -ClusterName connaks-dkc29c -ResourceGroupName connaks-rg-w9vlnp -RepositoryUrl http://github.com/xxxx
2627
PS C:\> Get-AzKubernetesConfiguration -InputObject $kubConf
2728
28-
Name Type
29-
---- ----
30-
conf-t02 Microsoft.KubernetesConfiguration/sourceControlConfigurations
29+
Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType Type
30+
---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ---------------------------- ----
31+
k8sconfig-t02 12/21/2020 5:29:33 AM 12/21/2020 5:29:33 AM Microsoft.KubernetesConfiguration/so…
3132
```
3233

3334
This command gets a configuration of kubernetes cluster by object.
3435

3536
### Example 4: Get a configuration of kubernetes cluster by pipeline
3637
```powershell
37-
PS C:\> @{Id='/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourceGroups/connaks-rg-w9vlnp/providers/Microsoft.Kubernetes/connectedClusters/connaks-d983yc/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/conf-test01'} | Get-AzKubernetesConfiguration
38+
PS C:\> @{Id='/subscriptions/xxxxx-xxxxxxx-xxxxx-xxxxxx/resourceGroups/connaks-rg-w9vlnp/providers/Microsoft.Kubernetes/connectedClusters/connaks-d983yc/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/k8sconfig-t02'} | Get-AzKubernetesConfiguration
3839
39-
Name Type
40-
---- ----
41-
conf-test01 Microsoft.KubernetesConfiguration/sourceControlConfigurations
40+
Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType Type
41+
---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ---------------------------- ----
42+
k8sconfig-t02 12/21/2020 5:29:33 AM 12/21/2020 5:29:33 AM Microsoft.KubernetesConfiguration/so…
4243
```
4344

4445
This command gets a configuration of kubernetes cluster by pipeline.
Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,22 @@
1-
### Example 1: Create a configuation for kubernetes cluster
1+
### Example 1: Create a configuration for kubernetes cluster
22
```powershell
3-
PS C:\> New-AzKubernetesConfiguration -Name conf-test01 -ClusterName connaks-d983yc -ResourceGroupName connaks-rg-w9vlnp -RepositoryUrl http://github.com/xxxx
3+
PS C:\> New-AzKubernetesConfiguration -ResourceGroupName azure-rg-test -ClusterName k8scluster-t01 -Name k8sconfig-t01 -RepositoryUrl http://github.com/xxxx
44
5-
Name Type
6-
---- ----
7-
conf-test01 Microsoft.KubernetesConfiguration/sourceControlConfigurations
5+
Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType Type
6+
---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ---------------------------- ----
7+
k8sconfig-t01 12/21/2020 5:26:17 AM 12/21/2020 5:26:17 AM Microsoft.KubernetesConfiguration/so…
88
```
99

10-
This command creates a configuation for kubernetes cluster.
10+
This command creates a configuration for kubernetes cluster.
11+
12+
### Example 1: Create a configuration for kubernetes cluster with specify paramter OperatorNamespace
13+
```powershell
14+
PS C:\> New-AzKubernetesConfiguration -ResourceGroupName azure-rg-test -ClusterName k8scluster-t01 -Name k8sconfig-t02 -RepositoryUrl http://github.com/xxxx -OperatorNamespace namespace-t01
15+
16+
Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType Type
17+
---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ---------------------------- ----
18+
k8sconfig-t02 12/21/2020 5:26:17 AM 12/21/2020 5:26:17 AM Microsoft.KubernetesConfiguration/so…
19+
```
20+
21+
This command creates a configuration in the new operator namespace for kubernetes cluster. Note, Unable to create a configuration in an existing operator namespace.
1122

0 commit comments

Comments
 (0)