Skip to content

Commit

Permalink
Release v3.4.1 (#36)
Browse files Browse the repository at this point in the history
Updates:
- new values in `network_interface` breakouts
- recreate the switch if `portcount` has been changed
  • Loading branch information
pogossian authored Sep 6, 2024
1 parent ecbfb85 commit 02be159
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ HOSTNAME=registry.terraform.io
NAMESPACE=netrisai
NAME=netris
BINARY=terraform-provider-${NAME}
VERSION=3.4.0
VERSION=3.4.1
OS_ARCH=darwin_arm64
WORKDIRECTORY=examples

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/network_interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ resource "netris_network_interface" "swp10_my-switch" {
### Optional

- **autoneg** (String) Toggle auto negotiation. Possible values: `default`, `on`, `off`. Default value is `default`
- **breakout** (String) Toggle breakout. Possible values: `off`, `4x10`, `4x25`, `4x100`, `manual`. Default value is `off`
- **breakout** (String) Toggle breakout. Possible values: `off`, `disabled`, `4x10`, `4x25`, `2x50`, `4x50`, `2x100`, `4x100`, `2x200`, `4x200`, `2x400`. Default value is `off`.
- **description** (String) Network Interface desired description
- **extension** (Map of String) Network Interface extension configurations.
- **mtu** (Number) MTU must be integer between 68 and 9216. Default value is `9000`
Expand Down
17 changes: 14 additions & 3 deletions netris/networkinterface/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,21 @@ import (

func validateBreakout(val interface{}, key string) (warns []string, errs []error) {
v := val.(string)
if !(v == "off" || v == "4x10" || v == "4x25" || v == "4x100" || v == "manual") {
errs = append(errs, fmt.Errorf("Breakout available values are (off, 4x10, 4x25, 4x100, manual)"))
return warns, errs
allowedValues := []string{"off", "disabled", "4x10", "4x25", "2x50", "4x50", "2x100", "4x100", "2x200", "4x200", "2x400"}

// Check if the provided value is in the list of allowed values
isValid := false
for _, allowedValue := range allowedValues {
if v == allowedValue {
isValid = true
break
}
}

if !isValid {
errs = append(errs, fmt.Errorf("Breakout available values are %v", allowedValues))
}

return warns, errs
}

Expand Down
1 change: 1 addition & 0 deletions netris/sw/sw.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ func Resource() *schema.Resource {
Type: schema.TypeInt,
Required: true,
Description: "Preliminary port count is used for definition of topology. Possible values: `16`, `32`, `48`, `54`, `56`, `64`",
ForceNew: true,
},
"breakout": {
Type: schema.TypeString,
Expand Down

0 comments on commit 02be159

Please sign in to comment.