@@ -42,17 +42,11 @@ function New-AzKubernetesConfiguration {
4242 # The name of the kubernetes cluster.
4343 ${ClusterName} ,
4444
45- [Parameter (Mandatory )]
45+ [Parameter ()]
4646 [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Category (' Path' )]
4747 [System.String ]
4848 # The Kubernetes cluster resource name - either managedClusters (for AKS clusters) or connectedClusters (for OnPrem K8S clusters).
49- ${ClusterResourceName} ,
50-
51- [Parameter (Mandatory )]
52- [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Category (' Path' )]
53- [System.String ]
54- # The Kubernetes cluster RP - either Microsoft.ContainerService (for AKS clusters) or Microsoft.Kubernetes (for OnPrem K8S clusters).
55- ${ClusterRp} ,
49+ ${ClusterType} ,
5650
5751 [Parameter (Mandatory )]
5852 [Alias (' SourceControlConfigurationName' )]
@@ -76,25 +70,6 @@ function New-AzKubernetesConfiguration {
7670 # 00000000-0000-0000-0000-000000000000)
7771 ${SubscriptionId} ,
7872
79- [Parameter ()]
80- [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Category (' Body' )]
81- [System.DateTime ]
82- # Datetime the configuration was last applied.
83- ${ComplianceStatusLastConfigApplied} ,
84-
85- [Parameter ()]
86- [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Category (' Body' )]
87- [System.String ]
88- # Message from when the configuration was applied.
89- ${ComplianceStatusMessage} ,
90-
91- [Parameter ()]
92- [ArgumentCompleter ([Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Support.MessageLevel ])]
93- [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Category (' Body' )]
94- [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Support.MessageLevel ]
95- # Level of the message.
96- ${ComplianceStatusMessageLevel} ,
97-
9873 [Parameter (Mandatory )]
9974 [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Category (' Body' )]
10075 [System.String ]
@@ -204,6 +179,17 @@ function New-AzKubernetesConfiguration {
204179 $PSBoundParameters.OperatorScope = [Microsoft.Azure.PowerShell.Cmdlets.KubernetesConfiguration.Support.OperatorScope ]::Namespace
205180 }
206181
182+ if ($PSBoundParameters.ContainsKey (' ClusterType' )) {
183+ if ($ClusterType -eq ' ManagedClusters' ) {
184+ $PSBoundParameters.Add (' ClusterRp' , ' Microsoft.Kubernetes' )
185+ } elseif ($ClusterType -eq ' ConnectedClusters' ) {
186+ $PSBoundParameters.Add (' ClusterRp' , ' Microsoft.ContainerService' )
187+ }
188+ } else {
189+ $PSBoundParameters.Add (' ClusterType' , ' ConnectedClusters' )
190+ $PSBoundParameters.Add (' ClusterRp' , ' Microsoft.ContainerService' )
191+ }
192+
207193 if ($PSBoundParameters.ContainsKey (' HelmOperatorChartValues' )) {
208194 $PSBoundParameters.Add (' HelmOperatorPropertyChartValue' , $HelmOperatorChartValues )
209195 $null = $PSBoundParameters.Remove (' HelmOperatorChartValues' )
0 commit comments