Skip to content

Commit

Permalink
add missing port_mirroring fields causing issue with UI
Browse files Browse the repository at this point in the history
  • Loading branch information
tmunzer committed Sep 18, 2024
1 parent d94319e commit 2bf4490
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 6 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ func switchMatchingRulesPortMirroringSdkToTerraform(ctx context.Context, diags *
var output_network basetypes.StringValue
var output_port_id basetypes.StringValue

if d.InputNetworksIngress != nil && len(d.InputNetworksIngress) > 0 {
if d.InputNetworksIngress != nil {
input_networks_ingress = mist_transform.ListOfStringSdkToTerraform(ctx, d.InputNetworksIngress)
}
if d.InputPortIdsEgress != nil && len(d.InputPortIdsEgress) > 0 {
if d.InputPortIdsEgress != nil {
input_port_ids_egress = mist_transform.ListOfStringSdkToTerraform(ctx, d.InputPortIdsEgress)
}
if d.InputPortIdsIngress != nil && len(d.InputPortIdsIngress) > 0 {
if d.InputPortIdsIngress != nil {
input_port_ids_ingress = mist_transform.ListOfStringSdkToTerraform(ctx, d.InputPortIdsIngress)
}
if d.OutputNetwork != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ func switchMatchingRulesPortMirroringTerraformToSdk(ctx context.Context, diags *
item_obj.InputPortIdsIngress = make([]string, 0)
}

if plan_obj.OutputNetwork.ValueStringPointer() != nil {
item_obj.OutputNetwork = models.ToPointer(plan_obj.OutputNetwork.ValueString())
}
if plan_obj.OutputPortId.ValueStringPointer() != nil {
item_obj.OutputPortId = models.ToPointer(plan_obj.OutputPortId.ValueString())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ func switchMatchingRulesPortMirroringSdkToTerraform(ctx context.Context, diags *
var output_network basetypes.StringValue
var output_port_id basetypes.StringValue

if d.InputNetworksIngress != nil && len(d.InputNetworksIngress) > 0 {
if d.InputNetworksIngress != nil {
input_networks_ingress = mist_transform.ListOfStringSdkToTerraform(ctx, d.InputNetworksIngress)
}
if d.InputPortIdsEgress != nil && len(d.InputPortIdsEgress) > 0 {
if d.InputPortIdsEgress != nil {
input_port_ids_egress = mist_transform.ListOfStringSdkToTerraform(ctx, d.InputPortIdsEgress)
}
if d.InputPortIdsIngress != nil && len(d.InputPortIdsIngress) > 0 {
if d.InputPortIdsIngress != nil {
input_port_ids_ingress = mist_transform.ListOfStringSdkToTerraform(ctx, d.InputPortIdsIngress)
}
if d.OutputNetwork != nil {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ func switchMatchingRulesPortMirroringTerraformToSdk(ctx context.Context, diags *
item_obj.InputPortIdsIngress = make([]string, 0)
}

if plan_obj.OutputNetwork.ValueStringPointer() != nil {
item_obj.OutputNetwork = models.ToPointer(plan_obj.OutputNetwork.ValueString())
}
if plan_obj.OutputPortId.ValueStringPointer() != nil {
item_obj.OutputPortId = models.ToPointer(plan_obj.OutputPortId.ValueString())
}
Expand Down

0 comments on commit 2bf4490

Please sign in to comment.