@@ -429,7 +429,7 @@ func (wr *WorkloadResource) Schema(ctx context.Context, req resource.SchemaReque
429429 listvalidator .SizeAtMost (1 ),
430430 },
431431 },
432- "ports" : schema.SetNestedBlock {
432+ "ports" : schema.ListNestedBlock {
433433 Description : "Communication endpoints used by the workload to send and receive network traffic." ,
434434 NestedObject : schema.NestedBlockObject {
435435 Attributes : map [string ]schema.Attribute {
@@ -1689,7 +1689,7 @@ func (wr *WorkloadResource) ModifyContainers(ctx context.Context, diags *diag.Di
16891689 }
16901690
16911691 // Build ports from container
1692- ports , ok := BuildSet [models.ContainerPortModel ](ctx , diags , container .Ports )
1692+ ports , ok := BuildList [models.ContainerPortModel ](ctx , diags , container .Ports )
16931693
16941694 // If the port number is still nil, extract the port number from the very first item of container ports
16951695 if ok && len (ports ) != 0 {
@@ -1713,7 +1713,7 @@ func (wr *WorkloadResource) ModifyContainers(ctx context.Context, diags *diag.Di
17131713 }
17141714
17151715 // Set ports back to container
1716- container .Ports = FlattenSet (ctx , diags , ports )
1716+ container .Ports = FlattenList (ctx , diags , ports )
17171717
17181718 // Set probes back to container
17191719 container .LivenessProbe = FlattenList (ctx , diags , livenessProbe )
@@ -2122,7 +2122,7 @@ func (wro *WorkloadResourceOperator) buildContainers(state types.List) *[]client
21222122 // Iterate over each block and construct an output item
21232123 for _ , block := range blocks {
21242124 // Build block ports
2125- ports , ok := BuildSet [models.ContainerPortModel ](wro .Ctx , wro .Diags , block .Ports )
2125+ ports , ok := BuildList [models.ContainerPortModel ](wro .Ctx , wro .Diags , block .Ports )
21262126
21272127 // Skip if ports are nil, this shouldn't happen but let's handle it anyway
21282128 if ! block .Ports .IsNull () && ! block .Ports .IsUnknown () && ! ok {
@@ -3302,15 +3302,15 @@ func (wro *WorkloadResourceOperator) flattenContainerMetrics(input *client.Workl
33023302 return FlattenList (wro .Ctx , wro .Diags , []models.ContainerMetricsModel {block })
33033303}
33043304
3305- // flattenContainerPort transforms *[]client.WorkloadContainerPort into a types.Set .
3306- func (wro * WorkloadResourceOperator ) flattenContainerPort (input * []client.WorkloadContainerPort ) types.Set {
3305+ // flattenContainerPort transforms *[]client.WorkloadContainerPort into a types.List .
3306+ func (wro * WorkloadResourceOperator ) flattenContainerPort (input * []client.WorkloadContainerPort ) types.List {
33073307 // Get attribute types
33083308 elementType := models.ContainerPortModel {}.AttributeTypes ()
33093309
33103310 // Check if the input is nil
33113311 if input == nil {
3312- // Return a null set
3313- return types .SetNull (elementType )
3312+ // Return a null list
3313+ return types .ListNull (elementType )
33143314 }
33153315
33163316 // Define the blocks slice
@@ -3328,8 +3328,8 @@ func (wro *WorkloadResourceOperator) flattenContainerPort(input *[]client.Worklo
33283328 blocks = append (blocks , block )
33293329 }
33303330
3331- // Return the successfully created types.Set
3332- return FlattenSet (wro .Ctx , wro .Diags , blocks )
3331+ // Return the successfully created types.List
3332+ return FlattenList (wro .Ctx , wro .Diags , blocks )
33333333}
33343334
33353335// flattenHealthCheck transforms *client.WorkloadHealthCheck into a types.List.
0 commit comments