@@ -15,11 +15,9 @@ const (
1515 clusterRKEConfigServicesKubeAPIAuditLogConfigPolicyAPIDefault = "audit.k8s.io/v1"
1616 clusterRKEConfigServicesKubeAPIEventRateLimitConfigAPIDefault = "eventratelimit.admission.k8s.io/v1alpha1"
1717 clusterRKEConfigServicesKubeAPIEncryptionConfigAPIDefault = "apiserver.config.k8s.io/v1"
18- clusterRKEConfigServicesKubeAPIAdmissionConfigAPIDefault = "apiserver.config.k8s.io/v1"
1918 clusterRKEConfigServicesKubeAPIAuditLogConfigPolicyKindDefault = "Policy"
2019 clusterRKEConfigServicesKubeAPIEventRateLimitConfigKindDefault = "Configuration"
2120 clusterRKEConfigServicesKubeAPIEncryptionConfigKindDefault = "EncryptionConfiguration"
22- clusterRKEConfigServicesKubeAPIAdmissionConfigKindDefault = "AdmissionConfiguration"
2321)
2422
2523var (
@@ -125,127 +123,6 @@ func clusterRKEConfigServicesKubeAPIAuditLogFields() map[string]*schema.Schema {
125123 return s
126124}
127125
128- func clusterRKEConfigServicesKubeAPIAdmissionConfigurationFieldsV0 () map [string ]* schema.Schema {
129- s := map [string ]* schema.Schema {
130- "api_version" : {
131- Type : schema .TypeString ,
132- Optional : true ,
133- Default : clusterRKEConfigServicesKubeAPIAdmissionConfigAPIDefault ,
134- Description : "Admission configuration ApiVersion" ,
135- },
136- "kind" : {
137- Type : schema .TypeString ,
138- Optional : true ,
139- Default : clusterRKEConfigServicesKubeAPIAdmissionConfigKindDefault ,
140- Description : "Admission configuration Kind" ,
141- },
142- "plugins" : {
143- Type : schema .TypeList ,
144- Optional : true ,
145- Computed : true ,
146- Elem : & schema.Resource {
147- Schema : clusterRKEConfigServicesKubeAPIAdmissionConfigPluginsFieldsV0 (),
148- },
149- Description : "Admission configuration plugins" ,
150- },
151- }
152- return s
153- }
154-
155- func clusterRKEConfigServicesKubeAPIAdmissionConfigurationFields () map [string ]* schema.Schema {
156- s := map [string ]* schema.Schema {
157- "api_version" : {
158- Type : schema .TypeString ,
159- Optional : true ,
160- Default : clusterRKEConfigServicesKubeAPIAdmissionConfigAPIDefault ,
161- Description : "Admission configuration ApiVersion" ,
162- },
163- "kind" : {
164- Type : schema .TypeString ,
165- Optional : true ,
166- Default : clusterRKEConfigServicesKubeAPIAdmissionConfigKindDefault ,
167- Description : "Admission configuration Kind" ,
168- },
169- "plugins" : {
170- Type : schema .TypeList ,
171- Optional : true ,
172- Computed : true ,
173- Elem : & schema.Resource {
174- Schema : clusterRKEConfigServicesKubeAPIAdmissionConfigPluginsFields (),
175- },
176- Description : "Admission configuration plugins" ,
177- },
178- }
179- return s
180- }
181-
182- func clusterRKEConfigServicesKubeAPIAdmissionConfigPluginsFieldsV0 () map [string ]* schema.Schema {
183- s := map [string ]* schema.Schema {
184- "name" : {
185- Type : schema .TypeString ,
186- Optional : true ,
187- Computed : true ,
188- Description : "Plugin name" ,
189- },
190- "path" : {
191- Type : schema .TypeString ,
192- Optional : true ,
193- Default : "" ,
194- Description : "Plugin path" ,
195- },
196- "configuration" : {
197- Type : schema .TypeString ,
198- Optional : true ,
199- Computed : true ,
200- Description : "Plugin configuration" ,
201- },
202- }
203- return s
204- }
205- func clusterRKEConfigServicesKubeAPIAdmissionConfigPluginsFields () map [string ]* schema.Schema {
206- s := map [string ]* schema.Schema {
207- "name" : {
208- Type : schema .TypeString ,
209- Optional : true ,
210- Computed : true ,
211- Description : "Plugin name" ,
212- },
213- "path" : {
214- Type : schema .TypeString ,
215- Optional : true ,
216- Default : "" ,
217- Description : "Plugin path" ,
218- },
219- "configuration" : {
220- Type : schema .TypeString ,
221- Optional : true ,
222- Computed : true ,
223- ValidateFunc : func (val interface {}, key string ) (warns []string , errs []error ) {
224- v , ok := val .(string )
225- if ! ok || len (v ) == 0 {
226- return
227- }
228- _ , err := ghodssyamlToMapInterface (v )
229- if err != nil {
230- errs = append (errs , fmt .Errorf ("%q must be in yaml format, error: %v" , key , err ))
231- return
232- }
233- return
234- },
235- DiffSuppressFunc : func (k , old , new string , d * schema.ResourceData ) bool {
236- if old == "" || new == "" {
237- return false
238- }
239- oldMap , _ := ghodssyamlToMapInterface (old )
240- newMap , _ := ghodssyamlToMapInterface (new )
241- return reflect .DeepEqual (oldMap , newMap )
242- },
243- Description : "Plugin configuration" ,
244- },
245- }
246- return s
247- }
248-
249126func clusterRKEConfigServicesKubeAPIEventRateLimitFieldsV0 () map [string ]* schema.Schema {
250127 s := map [string ]* schema.Schema {
251128 "configuration" : {
@@ -406,13 +283,8 @@ func clusterRKEConfigServicesKubeAPISecretsEncryptionConfigFieldsData() map[stri
406283func clusterRKEConfigServicesKubeAPIFieldsV0 () map [string ]* schema.Schema {
407284 s := map [string ]* schema.Schema {
408285 "admission_configuration" : {
409- Type : schema .TypeList ,
410- MaxItems : 1 ,
286+ Type : schema .TypeMap ,
411287 Optional : true ,
412- Elem : & schema.Resource {
413- Schema : clusterRKEConfigServicesKubeAPIAdmissionConfigurationFieldsV0 (),
414- },
415- Description : "Cluster admission configuration" ,
416288 },
417289 "always_pull_images" : {
418290 Type : schema .TypeBool ,
@@ -489,13 +361,8 @@ func clusterRKEConfigServicesKubeAPIFieldsV0() map[string]*schema.Schema {
489361func clusterRKEConfigServicesKubeAPIFields () map [string ]* schema.Schema {
490362 s := map [string ]* schema.Schema {
491363 "admission_configuration" : {
492- Type : schema .TypeList ,
493- MaxItems : 1 ,
364+ Type : schema .TypeMap ,
494365 Optional : true ,
495- Elem : & schema.Resource {
496- Schema : clusterRKEConfigServicesKubeAPIAdmissionConfigurationFields (),
497- },
498- Description : "Cluster admission configuration" ,
499366 },
500367 "always_pull_images" : {
501368 Type : schema .TypeBool ,
@@ -573,13 +440,8 @@ func clusterRKEConfigServicesKubeAPIFields() map[string]*schema.Schema {
573440func clusterRKEConfigServicesKubeAPIFieldsData () map [string ]* schema.Schema {
574441 s := map [string ]* schema.Schema {
575442 "admission_configuration" : {
576- Type : schema .TypeList ,
577- MaxItems : 1 ,
443+ Type : schema .TypeMap ,
578444 Optional : true ,
579- Elem : & schema.Resource {
580- Schema : clusterRKEConfigServicesKubeAPIAdmissionConfigurationFields (),
581- },
582- Description : "Cluster admission configuration" ,
583445 },
584446 "always_pull_images" : {
585447 Type : schema .TypeBool ,
0 commit comments