@@ -290,18 +290,15 @@ func generateModel(cfg models.Cluster, cluster *controlplanev1beta2.Cluster) (*m
290
290
}
291
291
292
292
if ! isAwsPrivateLinkSpecNil (cluster .AwsPrivateLink ) {
293
- ap , dg := types .ListValueFrom (ctx , types .StringType , cluster .AwsPrivateLink .AllowedPrincipals )
294
- if dg .HasError () {
295
- return nil , fmt .Errorf ("failed to parse AWS Private Link: %v" , dg )
296
- }
293
+ ap := utils .StringSliceToTypeList (cluster .AwsPrivateLink .AllowedPrincipals )
297
294
if ap .IsNull () {
298
295
// this must match the user's plan, which is currently required to be non-null
299
296
ap = types .ListValueMust (types .StringType , []attr.Value {})
300
297
}
301
298
output .AwsPrivateLink = & models.AwsPrivateLink {
302
299
Enabled : types .BoolValue (cluster .AwsPrivateLink .Enabled ),
303
300
ConnectConsole : types .BoolValue (cluster .AwsPrivateLink .ConnectConsole ),
304
- AllowedPrincipals : utils . StringSliceToTypeList ( cluster . AwsPrivateLink . AllowedPrincipals ) ,
301
+ AllowedPrincipals : ap ,
305
302
}
306
303
}
307
304
if ! isGcpPrivateServiceConnectSpecNil (cluster .GcpPrivateServiceConnect ) {
@@ -313,18 +310,15 @@ func generateModel(cfg models.Cluster, cluster *controlplanev1beta2.Cluster) (*m
313
310
}
314
311
315
312
if ! isAzurePrivateLinkSpecNil (cluster .AzurePrivateLink ) {
316
- as , dg := types .ListValueFrom (ctx , types .StringType , cluster .AzurePrivateLink .AllowedSubscriptions )
317
- if dg .HasError () {
318
- return nil , fmt .Errorf ("failed to parse Azure Private Link: %v" , dg )
319
- }
313
+ as := utils .StringSliceToTypeList (cluster .AzurePrivateLink .AllowedSubscriptions )
320
314
if as .IsNull () {
321
315
// this must match the user's plan, which is currently required to be non-null
322
316
as = types .ListValueMust (types .StringType , []attr.Value {})
323
317
}
324
318
output .AzurePrivateLink = & models.AzurePrivateLink {
325
319
Enabled : types .BoolValue (cluster .AzurePrivateLink .Enabled ),
326
320
ConnectConsole : types .BoolValue (cluster .AzurePrivateLink .ConnectConsole ),
327
- AllowedSubscriptions : utils . StringSliceToTypeList ( cluster . AzurePrivateLink . AllowedSubscriptions ) ,
321
+ AllowedSubscriptions : as ,
328
322
}
329
323
}
330
324
kAPI := toMtlsModel (cluster .GetKafkaApi ().GetMtls ())
0 commit comments