Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devel sync #35

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/resources/interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ resource "f5os_interface" "test_interface" {
For VELOS partitions blade/port format is required e.g. `1/1.0`
- `native_vlan` (Number) Configures the VLAN ID to associate with the interface.
The `native_vlan` parameter is used for untagged traffic.
- `trunk_vlans` (List of Number) Configures multiple VLAN IDs to associate with the interface.
- `trunk_vlans` (Set of Number) Configures multiple VLAN IDs to associate with the interface.
The `trunk_vlans` parameter is used for tagged traffic

### Read-Only
Expand Down
6 changes: 4 additions & 2 deletions docs/resources/lag.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ resource "f5os_lag" "test_lag" {

### Optional

- `members` (List of String) List of physical interfaces that are members of the LAG.
- `interval` (String) The LACP interval of the interface to be created.
- `members` (Set of String) List of physical interfaces that are members of the LAG. The members should be present on F5 platform and they shouldn't have any VLANs attached to it
- `mode` (String) The LACP mode of the interface to be created.
- `native_vlan` (Number) Configures the VLAN ID to associate with LAG interface.
The `native_vlan` parameter is used for untagged traffic.
- `trunk_vlans` (List of Number) Configures multiple VLAN IDs to associate with the LAG interface.
- `trunk_vlans` (Set of Number) Configures multiple VLAN IDs to associate with the LAG interface.
The `trunk_vlans` parameter is used for tagged traffic

### Read-Only
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module gitswarm.f5net.com/terraform-providers/terraform-provider-f5os

go 1.19
go 1.21.3

require (
github.com/hashicorp/terraform-plugin-docs v0.14.1
Expand All @@ -10,7 +10,7 @@ require (
github.com/hashicorp/terraform-plugin-log v0.8.0
github.com/hashicorp/terraform-plugin-testing v1.2.0
github.com/stretchr/testify v1.8.4
gitswarm.f5net.com/terraform-providers/f5osclient v1.0.2
gitswarm.f5net.com/terraform-providers/f5osclient v1.0.3
)

require (
Expand Down
11 changes: 9 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc=
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps=
github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0=
github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4=
github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E=
Expand All @@ -47,6 +48,7 @@ github.com/go-git/go-git-fixtures/v4 v4.2.1/go.mod h1:K8zd3kDUAykwTdDCr+I0per6Y6
github.com/go-git/go-git/v5 v5.4.2 h1:BXyZu9t0VkbiHtqrsvdq39UDhGJTl1h55VW6CSC4aY4=
github.com/go-git/go-git/v5 v5.4.2/go.mod h1:gQ1kArt6d+n+BGd+/B/I74HwRTLhth2+zti4ihgckDc=
github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
Expand Down Expand Up @@ -125,17 +127,20 @@ github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOl
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo=
github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4=
github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE=
github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74=
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck=
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
Expand Down Expand Up @@ -175,13 +180,15 @@ github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndr
github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo=
github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s=
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc=
github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU=
github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww=
github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ=
github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8=
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
Expand Down Expand Up @@ -211,8 +218,8 @@ github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6e
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/zclconf/go-cty v1.13.1 h1:0a6bRwuiSHtAmqCqNOE+c2oHgepv0ctoxU4FUe43kwc=
github.com/zclconf/go-cty v1.13.1/go.mod h1:YKQzy/7pZ7iq2jNFzy5go57xdxdWoLLpaEp4u238AE0=
gitswarm.f5net.com/terraform-providers/f5osclient v1.0.2 h1:RXDYEeXCYymbdPnbOt2XVQLVK2tYXWpfrQMZ607jDSQ=
gitswarm.f5net.com/terraform-providers/f5osclient v1.0.2/go.mod h1:XmqFs5vsbNni7scPBmJ0pWDIFa8i1NOnHoLnQPU/c98=
gitswarm.f5net.com/terraform-providers/f5osclient v1.0.3 h1:YbDdA8oViX9PDsHHBL8EcmHVq0f3f8cM2vyJ0/GunHI=
gitswarm.f5net.com/terraform-providers/f5osclient v1.0.3/go.mod h1:k+4tg9l6yO3FlFh3dkXGc+Wl+LOB/AXu302hAX6nhDU=
golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
Expand Down
68 changes: 68 additions & 0 deletions internal/provider/fixtures/f5os_lacp_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"openconfig-lacp:interface": [
{
"name": "tf-lag",
"config": {
"name": "tf-lag",
"interval": "FAST",
"lacp-mode": "ACTIVE"
},
"state": {
"name": "tf-lag",
"interval": "FAST",
"lacp-mode": "ACTIVE",
"system-id-mac": "f4:15:63:fb:a0:18"
},
"members": {
"member": [
{
"interface": "1.1",
"state": {
"interface": "1.1",
"activity": "ACTIVE",
"timeout": "SHORT",
"synchronization": "OUT_SYNC",
"aggregatable": true,
"collecting": false,
"distributing": false,
"system-id": "f4:15:63:fb:a0:18",
"oper-key": 15,
"partner-id": "00:00:00:00:00:00",
"partner-key": 0,
"port-num": 8320,
"partner-port-num": 0,
"counters": {
"lacp-in-pkts": "0",
"lacp-out-pkts": "3610",
"lacp-rx-errors": "0"
}
}
},
{
"interface": "1.2",
"state": {
"interface": "1.2",
"activity": "ACTIVE",
"timeout": "SHORT",
"synchronization": "OUT_SYNC",
"aggregatable": true,
"collecting": false,
"distributing": false,
"system-id": "f4:15:63:fb:a0:18",
"oper-key": 15,
"partner-id": "00:00:00:00:00:00",
"partner-key": 0,
"port-num": 8448,
"partner-port-num": 0,
"counters": {
"lacp-in-pkts": "0",
"lacp-out-pkts": "3610",
"lacp-rx-errors": "0"
}
}
}
]
}
}
]
}
6 changes: 3 additions & 3 deletions internal/provider/interface_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type InterfaceResource struct {
type InterfaceResourceModel struct {
Name types.String `tfsdk:"name"`
NativeVlan types.Int64 `tfsdk:"native_vlan"`
TrunkVlans types.List `tfsdk:"trunk_vlans"`
TrunkVlans types.Set `tfsdk:"trunk_vlans"`
Enabled types.Bool `tfsdk:"enabled"`
Status types.String `tfsdk:"status"`
Id types.String `tfsdk:"id"`
Expand All @@ -55,7 +55,7 @@ func (r *InterfaceResource) Schema(ctx context.Context, req resource.SchemaReque
MarkdownDescription: "Configures the VLAN ID to associate with the interface.\nThe `native_vlan` parameter is used for untagged traffic.",
Optional: true,
},
"trunk_vlans": schema.ListAttribute{
"trunk_vlans": schema.SetAttribute{
MarkdownDescription: "Configures multiple VLAN IDs to associate with the interface.\nThe `trunk_vlans` parameter is used for tagged traffic",
Optional: true,
ElementType: types.Int64Type,
Expand Down Expand Up @@ -230,7 +230,7 @@ func (r *InterfaceResource) interfaceResourceModelToState(ctx context.Context, r
if int64(respData.OpenconfigInterfacesInterface[0].OpenconfigIfEthernetEthernet.OpenconfigVlanSwitchedVlan.Config.NativeVlan) != 0 {
data.NativeVlan = types.Int64Value(int64(respData.OpenconfigInterfacesInterface[0].OpenconfigIfEthernetEthernet.OpenconfigVlanSwitchedVlan.Config.NativeVlan))
}
data.TrunkVlans, _ = types.ListValueFrom(ctx, types.Int64Type, respData.OpenconfigInterfacesInterface[0].OpenconfigIfEthernetEthernet.OpenconfigVlanSwitchedVlan.Config.TrunkVlans)
data.TrunkVlans, _ = types.SetValueFrom(ctx, types.Int64Type, respData.OpenconfigInterfacesInterface[0].OpenconfigIfEthernetEthernet.OpenconfigVlanSwitchedVlan.Config.TrunkVlans)
}

func getInterfaceConfig(ctx context.Context, data *InterfaceResourceModel) *f5ossdk.F5ReqOpenconfigInterface {
Expand Down
Loading