@@ -20,18 +20,20 @@ Create a new Kubernetes Source Control Configuration.
20
20
. Description
21
21
Create a new Kubernetes Source Control Configuration.
22
22
. Example
23
- {{ Add code here }}
23
+ New-AzConnectedKubernetes -ClusterName azpstest_cluster_arc -ResourceGroupName azps_test_group -Location eastus -KubeConfig $HOME\.kube\config -KubeContext azps_aks_t01
24
+ New-AzKubernetesConfiguration -ResourceGroupName azps_test_group -ClusterName azpstest_cluster_arc -Name azpstestk8s -RepositoryUrl http://github.com/xxxx -ClusterType ConnectedClusters
24
25
. Example
25
- {{ Add code here }}
26
+ New-AzConnectedKubernetes -ClusterName azpstest_cluster_arc -ResourceGroupName azps_test_group -Location eastus -KubeConfig $HOME\.kube\config -KubeContext azps_aks_t01
27
+ New-AzKubernetesConfiguration -ResourceGroupName azps_test_group -ClusterName azpstest_cluster_arc -Name azpstestk8s-operator -RepositoryUrl http://github.com/xxxx -OperatorScope 'cluster' -ClusterType ConnectedClusters
26
28
27
29
. Outputs
28
- Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Models.Api20221101. ISourceControlConfiguration
30
+ Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Models.ISourceControlConfiguration
29
31
. Link
30
32
https://learn.microsoft.com/powershell/module/az.kubernetesconfiguration/new-azkubernetesconfiguration
31
33
#>
32
34
function New-AzKubernetesConfiguration {
33
35
[Alias (' New-AzK8sConfiguration' )]
34
- [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Models.Api20221101. ISourceControlConfiguration ])]
36
+ [OutputType ([Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Models.ISourceControlConfiguration ])]
35
37
[CmdletBinding (DefaultParameterSetName = ' CreateExpanded' , PositionalBinding = $false , SupportsShouldProcess , ConfirmImpact = ' Medium' )]
36
38
param (
37
39
[Parameter (Mandatory )]
@@ -71,15 +73,14 @@ function New-AzKubernetesConfiguration {
71
73
72
74
[Parameter ()]
73
75
[Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Category (' Body' )]
74
- [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Runtime.Info (PossibleTypes = ([Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Models.Api20221101. IConfigurationProtectedSettings ]))]
76
+ [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Runtime.Info (PossibleTypes = ([Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Models.IConfigurationProtectedSettings ]))]
75
77
[System.Collections.Hashtable ]
76
78
# Name-value pairs of protected configuration settings for the configuration
77
79
${ConfigurationProtectedSetting} ,
78
80
79
81
[Parameter ()]
80
82
[Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Category (' Body' )]
81
83
[System.Management.Automation.SwitchParameter ]
82
- [switch ]
83
84
# Option to enable Helm Operator for this git configuration.
84
85
${EnableHelmOperator} ,
85
86
@@ -115,16 +116,16 @@ function New-AzKubernetesConfiguration {
115
116
${OperatorParam} ,
116
117
117
118
[Parameter ()]
118
- [ArgumentCompleter ([ Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Support.OperatorScopeType ] )]
119
+ [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.PSArgumentCompleterAttribute ( " cluster " , " namespace " )]
119
120
[Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Category (' Body' )]
120
- [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Support.OperatorScopeType ]
121
+ [System.String ]
121
122
# Scope at which the operator will be installed.
122
123
${OperatorScope} ,
123
124
124
125
[Parameter ()]
125
- [ArgumentCompleter ([ Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Support.OperatorType ] )]
126
+ [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.PSArgumentCompleterAttribute ( " Flux " )]
126
127
[Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Category (' Body' )]
127
- [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Support.OperatorType ]
128
+ [System.String ]
128
129
# Type of the operator
129
130
${OperatorType} ,
130
131
@@ -196,10 +197,10 @@ function New-AzKubernetesConfiguration {
196
197
process {
197
198
try {
198
199
if ($PSBoundParameters.ContainsKey (' ClusterScoped' )) {
199
- $PSBoundParameters.OperatorScope = [ Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Support.OperatorScopeType ]:: Cluster
200
+ $PSBoundParameters.OperatorScope = ' Cluster'
200
201
}
201
202
else {
202
- $PSBoundParameters.OperatorScope = [ Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Support.OperatorScopeType ]:: Namespace
203
+ $PSBoundParameters.OperatorScope = ' Namespace'
203
204
}
204
205
205
206
if ($ClusterType -eq ' ManagedClusters' ) {
@@ -215,7 +216,7 @@ function New-AzKubernetesConfiguration {
215
216
Write-Error " Please select ClusterType from the following three values: 'ManagedClusters', 'ConnectedClusters', 'ProvisionedClusters'"
216
217
}
217
218
218
- $PSBoundParameters.Add (' OperatorType' , [ Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Support.OperatorType ]:: Flux)
219
+ $PSBoundParameters.Add (' OperatorType' , ' Flux' )
219
220
220
221
write-host " Azure Kubernetes Configuration is being created, need to wait a few minutes..."
221
222
Az.KubernetesConfiguration.internal\New-AzKubernetesConfiguration @PSBoundParameters
0 commit comments