Skip to content

Commit

Permalink
Merge pull request #455 from jeremmfr/main
Browse files Browse the repository at this point in the history
Release v1.33.0
  • Loading branch information
jeremmfr authored Feb 7, 2023
2 parents b15ea77 + 0fa13a1 commit 5bafadb
Show file tree
Hide file tree
Showing 17 changed files with 64 additions and 54 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Go Tests
on: [push, pull_request]
jobs:
build-1_18:
name: Build 1.18
build-1_19:
name: Build 1.19
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.18
- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: '1.19'
check-latest: true
id: go
- name: Disable cgo
Expand All @@ -21,14 +21,14 @@ jobs:
- name: Build
run: go build -v .

build-1_19:
name: Build 1.19
build-1_20:
name: Build 1.20
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
check-latest: true
id: go
- name: Disable cgo
Expand All @@ -45,10 +45,10 @@ jobs:
name: Test
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
check-latest: true
id: go
- name: Disable cgo
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/go_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Running govulncheck
uses: Templum/[email protected].8
uses: Templum/[email protected].9
with:
go-version: 1.19
go-version: '1.20'
vulncheck-version: latest
package: ./...
fail-on-vuln: false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linters-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
name: golangci-lint-latest
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
check-latest: true
id: go
- name: Disable cgo
Expand Down
35 changes: 5 additions & 30 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ jobs:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
check-latest: true
id: go
- name: Disable cgo
Expand All @@ -19,7 +19,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.50
version: v1.51
args: -c .golangci.yml -v

markdown-lint:
Expand All @@ -38,10 +38,10 @@ jobs:
name: terrafmt
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: '1.20'
check-latest: true
id: go
- name: Show version
Expand Down Expand Up @@ -71,28 +71,3 @@ jobs:
echo "terraform blocks in website/test-go files not being properly formatted"
exit 1
fi
# see https://github.com/bflad/tfproviderlint/issues/255
# tfproviderlint:
# name: tfproviderlint
# runs-on: ubuntu-latest
# steps:
# - name: Set up Go 1.18
# uses: actions/setup-go@v3
# with:
# go-version: 1.18
# check-latest: true
# id: go
# - name: Show version
# run: go version
# - name: Check out code
# uses: actions/checkout@v3
# - name: Check out tfproviderlint code
# uses: actions/checkout@v3
# with:
# repository: bflad/tfproviderlint
# ref: v0.28.1
# path: tfproviderlint
# - name: Build tfproviderlint bin
# run: cd tfproviderlint && go install ./... && cd ${GITHUB_WORKSPACE}
# - name: Run tfproviderlint
# run: tfproviderlint -AT001=false -AT006=false -R007=false -R009=false -R014=false -R018=false ./...
4 changes: 2 additions & 2 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ jobs:
- goos: windows
goarch: arm64
steps:
- name: Set up Go 1.19
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: ^1.19.2
go-version: '^1.20.0'
check-latest: true
id: go
- name: Show version
Expand Down
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ linters:
- maintidx
- execinquery
- nosnakecase
- musttag
linters-settings:
gocognit:
# minimal code complexity to report, 30 by default
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ ENHANCEMENTS:

BUG FIXES:

## 1.33.0 (February 07, 2023)

ENHANCEMENTS:

* resource/`junos_interface_physical`: add `mtu` argument (Fixes [#451](https://github.com/jeremmfr/terraform-provider-junos/issues/451))
* data-source/`junos_interface_physical`: add `mtu` attribute (like resource)
* release now with golang 1.20

## 1.32.0 (December 22, 2022)

ENHANCEMENTS:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ for provider and resources documentation.

### In addition to develop

- [Go](https://golang.org/doc/install) `v1.18` or `v1.19`
- [Go](https://golang.org/doc/install) `v1.19` or `v1.20`

## Automatic install (Terraform 0.13 and later)

Expand Down
2 changes: 2 additions & 0 deletions docs/data-sources/interface_physical.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ The following attributes are exported:
Don't enable loopback.
- **redundant_parent** (String)
Name of a redundant ethernet interface to join.
- **mtu** (Optional, Number)
Maximum transmission unit.
- **parent_ether_opts** (Block)
The `aggregated-ether-options` or `redundant-ether-options` configuration
(it depends on the interface `name`).
Expand Down
2 changes: 2 additions & 0 deletions docs/resources/interface_physical.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ The following arguments are supported:
Don't enable loopback.
- **redundant_parent** (Optional, String)
Name of a redundant ethernet interface to join.
- **mtu** (Optional, Number)
Maximum transmission unit.
- **parent_ether_opts** (Optional, Block)
Declare `aggregated-ether-options` or `redundant-ether-options` configuration
(it depends on the interface `name`).
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/security_address_book.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ The following arguments are supported:
- **value** (Required, String)
Network and mask of wildcard address (`192.0.0.0/255.255.0.255`).
- **description** (Optional, String)
Description of network address.
Description of wildcard address.
- **dns_name** (Optional, Block Set)
For each name of dns name address.
- **name** (Required, String)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/jeremmfr/terraform-provider-junos

go 1.18
go 1.19

require (
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
Expand Down
4 changes: 4 additions & 0 deletions junos/data_source_interface_physical.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ func dataSourceInterfacePhysical() *schema.Resource {
},
},
},
"mtu": {
Type: schema.TypeInt,
Computed: true,
},
"parent_ether_opts": {
Type: schema.TypeList,
Computed: true,
Expand Down
4 changes: 2 additions & 2 deletions junos/resource_interface_logical.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ func resourceInterfaceLogical() *schema.Resource {
"mtu": {
Type: schema.TypeInt,
Optional: true,
ValidateFunc: validation.IntBetween(500, 9192),
ValidateFunc: validation.IntBetween(1, 9500),
},
"rpf_check": {
Type: schema.TypeList,
Expand Down Expand Up @@ -559,7 +559,7 @@ func resourceInterfaceLogical() *schema.Resource {
"mtu": {
Type: schema.TypeInt,
Optional: true,
ValidateFunc: validation.IntBetween(500, 9192),
ValidateFunc: validation.IntBetween(1, 9500),
},
"rpf_check": {
Type: schema.TypeList,
Expand Down
17 changes: 17 additions & 0 deletions junos/resource_interface_physical.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type interfacePhysicalOptions struct {
trunk bool
vlanTagging bool
aeMinLink int
mtu int
vlanNative int
aeLacp string
aeLinkSpeed string
Expand Down Expand Up @@ -282,6 +283,11 @@ func resourceInterfacePhysical() *schema.Resource {
},
},
},
"mtu": {
Type: schema.TypeInt,
Optional: true,
ValidateFunc: validation.IntBetween(1, 9500),
},
"parent_ether_opts": {
Type: schema.TypeList,
Optional: true,
Expand Down Expand Up @@ -1039,6 +1045,9 @@ func setInterfacePhysical(d *schema.ResourceData, clt *Client, junSess *junosSes
configSet = append(configSet, "set chassis aggregated-devices ethernet device-count "+aggregatedCount)
}
}
if v := d.Get("mtu").(int); v != 0 {
configSet = append(configSet, setPrefix+"mtu "+strconv.Itoa(v))
}
for _, v := range d.Get("parent_ether_opts").([]interface{}) {
if v == nil {
return fmt.Errorf("parent_ether_opts block is empty")
Expand Down Expand Up @@ -1262,6 +1271,11 @@ func readInterfacePhysical(interFace string, clt *Client, junSess *junosSession,
confRead.readInterfacePhysicalEtherOpts(itemTrim)
case balt.CutPrefixInString(&itemTrim, "gigether-options "):
confRead.readInterfacePhysicalGigetherOpts(itemTrim)
case balt.CutPrefixInString(&itemTrim, "mtu "):
confRead.mtu, err = strconv.Atoi(itemTrim)
if err != nil {
return confRead, fmt.Errorf(failedConvAtoiError, itemTrim, err)
}
case balt.CutPrefixInString(&itemTrim, "native-vlan-id "):
confRead.vlanNative, err = strconv.Atoi(itemTrim)
if err != nil {
Expand Down Expand Up @@ -1714,6 +1728,9 @@ func fillInterfacePhysicalData(d *schema.ResourceData, interfaceOpt interfacePhy
panic(tfErr)
}
}
if tfErr := d.Set("mtu", interfaceOpt.mtu); tfErr != nil {
panic(tfErr)
}
if !okAeLacp && !okAeLinkSpeed && !okAeMinLinks {
if tfErr := d.Set("parent_ether_opts", interfaceOpt.parentEtherOpts); tfErr != nil {
panic(tfErr)
Expand Down
1 change: 1 addition & 0 deletions junos/resource_interface_physical_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ resource "junos_interface_physical" "testacc_interface2" {
loopback = true
auto_negotiation = true
}
mtu = 9000
}
resource "junos_interface_logical" "testacc_interfaceLO" {
name = "lo0.0"
Expand Down
6 changes: 3 additions & 3 deletions junos/resource_policyoptions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ func TestAccJunosPolicyOptions_basic(t *testing.T) {
resource.TestCheckResourceAttr("junos_policyoptions_policy_statement.testacc_policyOptions",
"then.0.action", "accept"),
resource.TestCheckResourceAttr("junos_policyoptions_policy_statement.testacc_policyOptions",
"then.0.as_path_expand", "65000 65000"), //nolint: dupword
"then.0.as_path_expand", "65000 65000"),
resource.TestCheckResourceAttr("junos_policyoptions_policy_statement.testacc_policyOptions",
"then.0.as_path_prepend", "65000 65000"), //nolint: dupword
"then.0.as_path_prepend", "65000 65000"),
resource.TestCheckResourceAttr("junos_policyoptions_policy_statement.testacc_policyOptions",
"then.0.community.#", "3"),
resource.TestCheckResourceAttr("junos_policyoptions_policy_statement.testacc_policyOptions",
Expand Down Expand Up @@ -289,7 +289,7 @@ func TestAccJunosPolicyOptions_basic(t *testing.T) {
resource.TestCheckResourceAttr("junos_policyoptions_policy_statement.testacc_policyOptions",
"term.0.then.0.as_path_expand", "last-as count 1"),
resource.TestCheckResourceAttr("junos_policyoptions_policy_statement.testacc_policyOptions",
"term.0.then.0.as_path_prepend", "65000 65000"), //nolint: dupword
"term.0.then.0.as_path_prepend", "65000 65000"),
resource.TestCheckResourceAttr("junos_policyoptions_policy_statement.testacc_policyOptions",
"term.0.then.0.community.#", "3"),
resource.TestCheckResourceAttr("junos_policyoptions_policy_statement.testacc_policyOptions",
Expand Down

0 comments on commit 5bafadb

Please sign in to comment.