Skip to content

Commit

Permalink
Merge pull request #434 from jeremmfr/main
Browse files Browse the repository at this point in the history
Release v1.31.1
  • Loading branch information
jeremmfr authored Oct 14, 2022
2 parents c8d451b + 6a88695 commit a6515ff
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 66 deletions.
42 changes: 22 additions & 20 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ jobs:
run: echo "RELEASE_VERSION=$(echo ${GITHUB_REF} | cut -d'/' -f3)" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
uses: ncipollo/release-action@v1
with:
tag_name: ${{ github.ref }}
release_name: ${{ env.RELEASE_VERSION }}
body: ${{ env.RELEASE_VERSION }}
token: ${{ secrets.RELEASE_TOKEN }}
name: ${{ env.RELEASE_VERSION }}
omitBody: true
draft: true
prerelease: false

Expand Down Expand Up @@ -78,14 +76,16 @@ jobs:
- name: Create archive zip
run: zip ${REPO_NAME}_${RELEASE_VERSION}_${{ matrix.goos }}_${{ matrix.goarch }}.zip ${REPO_NAME}_v${RELEASE_VERSION}*
- name: Upload archive zip to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ncipollo/release-action@v1
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./${{ env.REPO_NAME }}_${{ env.RELEASE_VERSION }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip
asset_name: ${{ env.REPO_NAME }}_${{ env.RELEASE_VERSION }}_${{ matrix.goos }}_${{ matrix.goarch }}.zip
asset_content_type: application/zip
token: ${{ secrets.RELEASE_TOKEN }}
allowUpdates: true
omitNameDuringUpdate: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitPrereleaseDuringUpdate: true
artifactContentType: application/zip
artifacts: "${{ env.REPO_NAME }}_${{ env.RELEASE_VERSION }}_*.zip"

shasum_zip:
name: Create sha256 sum for each zip
Expand Down Expand Up @@ -117,11 +117,13 @@ jobs:
- name: Generate SHA256SUMS
run: shasum -a 256 ${{ env.REPO_NAME }}_${{ env.RELEASE_VERSION }}_*.zip > ${{ env.REPO_NAME }}_${{ env.RELEASE_VERSION }}_SHA256SUMS
- name: Upload shasum result
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: ncipollo/release-action@v1
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: ./${{ env.REPO_NAME }}_${{ env.RELEASE_VERSION }}_SHA256SUMS
asset_name: ${{ env.REPO_NAME }}_${{ env.RELEASE_VERSION }}_SHA256SUMS
asset_content_type: application/octet-stream
token: ${{ secrets.RELEASE_TOKEN }}
allowUpdates: true
omitNameDuringUpdate: true
omitBodyDuringUpdate: true
omitDraftDuringUpdate: true
omitPrereleaseDuringUpdate: true
artifactContentType: application/octet-stream
artifacts: ${{ env.REPO_NAME }}_${{ env.RELEASE_VERSION }}_SHA256SUMS
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ ENHANCEMENTS:

BUG FIXES:

## 1.31.1 (October 14, 2022)

BUG FIXES:

* resource/`junos_security_global_policy`: fix error reading config when an element of `permit_application_services` have the suffix `permit`, `deny` or `reject` (Fixes [#430](https://github.com/jeremmfr/terraform-provider-junos/issues/430))
* resource/`junos_security_policy`: fix error reading config when an element of `permit_application_services` have the suffix `permit`, `deny` or `reject`

## 1.31.0 (October 12, 2022)

FEATURES:
Expand Down
6 changes: 3 additions & 3 deletions junos/resource_chassis_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,9 +488,9 @@ func delChassisCluster(clt *Client, junSess *junosSession) error {
listLinesToDelete = append(listLinesToDelete, "chassis cluster")
listLinesToDelete = append(listLinesToDelete, "interfaces fab0")
listLinesToDelete = append(listLinesToDelete, "interfaces fab1")
configSet := make([]string, 0)
for _, line := range listLinesToDelete {
configSet = append(configSet, deleteLS+line)
configSet := make([]string, len(listLinesToDelete))
for k, line := range listLinesToDelete {
configSet[k] = deleteLS + line
}

return clt.configSet(configSet, junSess)
Expand Down
2 changes: 1 addition & 1 deletion junos/resource_interface_physical.go
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,7 @@ func checkInterfacePhysicalContainsUnit(interFace string, clt *Client, junSess *
}

func delInterfaceNC(d *schema.ResourceData, clt *Client, junSess *junosSession) error {
configSet := make([]string, 0, 1)
configSet := make([]string, 0, 3)
delPrefix := "delete interfaces " + d.Get("name").(string) + " "
if clt.groupIntDel != "" {
configSet = append(configSet, delPrefix+"apply-groups "+clt.groupIntDel)
Expand Down
8 changes: 3 additions & 5 deletions junos/resource_ospf.go
Original file line number Diff line number Diff line change
Expand Up @@ -871,8 +871,6 @@ func readOspf(version, routingInstance string, clt *Client, junSess *junosSessio
}

func delOspf(d *schema.ResourceData, clt *Client, junSess *junosSession) error {
configSet := make([]string, 0, 1)

ospfVersion := ospfV2
if d.Get("version").(string) == "v3" {
ospfVersion = ospfV3
Expand Down Expand Up @@ -904,9 +902,9 @@ func delOspf(d *schema.ResourceData, clt *Client, junSess *junosSession) error {
"sham-link",
"spf-options",
}

for _, line := range listLinesToDelete {
configSet = append(configSet, delPrefix+line)
configSet := make([]string, len(listLinesToDelete))
for k, line := range listLinesToDelete {
configSet[k] = delPrefix + line
}

return clt.configSet(configSet, junSess)
Expand Down
6 changes: 3 additions & 3 deletions junos/resource_rip_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,6 @@ func delRipGroup(
if deleteAll {
return clt.configSet([]string{delPrefix}, junSess)
}
configSet := make([]string, 0, 10)
listLinesToDelete := []string{
"bfd-liveness-detection",
"demand-circuit",
Expand All @@ -754,8 +753,9 @@ func delRipGroup(
"route-timeout",
"update-interval",
}
for _, line := range listLinesToDelete {
configSet = append(configSet, delPrefix+line)
configSet := make([]string, len(listLinesToDelete))
for k, line := range listLinesToDelete {
configSet[k] = delPrefix + line
}

return clt.configSet(configSet, junSess)
Expand Down
8 changes: 4 additions & 4 deletions junos/resource_rstp.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,6 @@ func readRstp(routingInstance string, clt *Client, junSess *junosSession) (rstpO
}

func delRstp(d *schema.ResourceData, clt *Client, junSess *junosSession) error {
configSet := make([]string, 0, 1)
delPrefix := deleteLS
if d.Get("routing_instance").(string) != defaultW {
delPrefix = delRoutingInstances + d.Get("routing_instance").(string) + " "
Expand All @@ -515,9 +514,10 @@ func delRstp(d *schema.ResourceData, clt *Client, junSess *junosSession) error {
"system-identifier",
"vpls-flush-on-topology-change",
}

for _, line := range listLinesToDelete {
configSet = append(configSet, delPrefix+line)
configSet := make([]string,
len(listLinesToDelete), len(listLinesToDelete)+len(d.Get("system_id").(*schema.Set).List()))
for k, line := range listLinesToDelete {
configSet[k] = delPrefix + line
}
if d.HasChange("system_id") {
oSysID, _ := d.GetChange("system_id")
Expand Down
6 changes: 3 additions & 3 deletions junos/resource_security_global_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,9 +485,9 @@ func readSecurityGlobalPolicy(clt *Client, junSess *junosSession) (globalPolicyO
itemTrimPolicy, "match source-end-user-profile "), "\"")
case strings.HasPrefix(itemTrimPolicy, "then "):
switch {
case strings.HasSuffix(itemTrimPolicy, permitW),
strings.HasSuffix(itemTrimPolicy, "deny"),
strings.HasSuffix(itemTrimPolicy, "reject"):
case itemTrimPolicy == "then permit",
itemTrimPolicy == "then deny",
itemTrimPolicy == "then reject":
policy["then"] = strings.TrimPrefix(itemTrimPolicy, "then ")
case itemTrimPolicy == "then count":
policy["count"] = true
Expand Down
6 changes: 3 additions & 3 deletions junos/resource_security_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,9 @@ func readSecurityPolicy(fromZone, toZone string, clt *Client, junSess *junosSess
itemTrimPolicy, "match source-end-user-profile "), "\"")
case strings.HasPrefix(itemTrimPolicy, "then "):
switch {
case strings.HasSuffix(itemTrimPolicy, permitW),
strings.HasSuffix(itemTrimPolicy, "deny"),
strings.HasSuffix(itemTrimPolicy, "reject"):
case itemTrimPolicy == "then permit",
itemTrimPolicy == "then deny",
itemTrimPolicy == "then reject":
policy["then"] = strings.TrimPrefix(itemTrimPolicy, "then ")
case itemTrimPolicy == "then count":
policy["count"] = true
Expand Down
6 changes: 3 additions & 3 deletions junos/resource_security_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,10 +747,10 @@ func delSecurityZoneOpts(zone string, addressBookSingly bool, clt *Client, junSe
if !addressBookSingly {
listLinesToDelete = append(listLinesToDelete, "address-book")
}
configSet := make([]string, 0, 1)
delPrefix := "delete security zones security-zone " + zone + " "
for _, line := range listLinesToDelete {
configSet = append(configSet, delPrefix+line)
configSet := make([]string, len(listLinesToDelete))
for k, line := range listLinesToDelete {
configSet[k] = delPrefix + line
}

return clt.configSet(configSet, junSess)
Expand Down
22 changes: 11 additions & 11 deletions junos/resource_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -1241,29 +1241,29 @@ func delServices(d *schema.ResourceData, cleanAll bool, clt *Client, junSess *ju
listLinesToDelete = append(listLinesToDelete, listLinesServicesSecurityIntel()...)
listLinesToDelete = append(listLinesToDelete, listLinesServicesUserIdentification()...)

configSet := make([]string, 0)
delPrefix := "delete services "
for _, line := range listLinesToDelete {
configSet = append(configSet,
delPrefix+line)
}

if len(d.Get("advanced_anti_malware").([]interface{})) == 0 || cleanAll {
configSet = append(configSet, delPrefix+"advanced-anti-malware connection")
listLinesToDelete = append(listLinesToDelete, "advanced-anti-malware connection")
} else {
advAntiMalware := d.Get("advanced_anti_malware").([]interface{})[0].(map[string]interface{})
if len(advAntiMalware["connection"].([]interface{})) == 0 {
configSet = append(configSet, delPrefix+"advanced-anti-malware connection")
listLinesToDelete = append(listLinesToDelete, "advanced-anti-malware connection")
}
}
if len(d.Get("application_identification").([]interface{})) == 0 || cleanAll {
configSet = append(configSet, delPrefix+"application-identification")
listLinesToDelete = append(listLinesToDelete, "application-identification")
}
if len(d.Get("security_intelligence").([]interface{})) == 0 || cleanAll {
configSet = append(configSet, delPrefix+"security-intelligence authentication")
configSet = append(configSet, delPrefix+"security-intelligence url")
listLinesToDelete = append(listLinesToDelete, "security-intelligence authentication")
listLinesToDelete = append(listLinesToDelete, "security-intelligence url")
}
if len(d.Get("user_identification").([]interface{})) == 0 || cleanAll {
configSet = append(configSet, delPrefix+"user-identification active-directory-access")
listLinesToDelete = append(listLinesToDelete, "user-identification active-directory-access")
}
configSet := make([]string, len(listLinesToDelete))
for k, line := range listLinesToDelete {
configSet[k] = delPrefix + line
}

return clt.configSet(configSet, junSess)
Expand Down
8 changes: 4 additions & 4 deletions junos/resource_vstp.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ func readVstp(routingInstance string, clt *Client, junSess *junosSession) (vstpO
}

func delVstp(d *schema.ResourceData, clt *Client, junSess *junosSession) error {
configSet := make([]string, 0, 1)
delPrefix := deleteLS
if d.Get("routing_instance").(string) != defaultW {
delPrefix = delRoutingInstances + d.Get("routing_instance").(string) + " "
Expand All @@ -398,9 +397,10 @@ func delVstp(d *schema.ResourceData, clt *Client, junSess *junosSession) error {
"priority-hold-time",
"vpls-flush-on-topology-change",
}

for _, line := range listLinesToDelete {
configSet = append(configSet, delPrefix+line)
configSet := make([]string,
len(listLinesToDelete), len(listLinesToDelete)+len(d.Get("system_id").(*schema.Set).List()))
for k, line := range listLinesToDelete {
configSet[k] = delPrefix + line
}
if d.HasChange("system_id") {
oSysID, _ := d.GetChange("system_id")
Expand Down
6 changes: 3 additions & 3 deletions junos/resource_vstp_vlan.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,6 @@ func readVstpVlan(vlanID, routingInstance string, clt *Client, junSess *junosSes
}

func delVstpVlan(vlanID, routingInstance string, deleteAll bool, clt *Client, junSess *junosSession) error {
configSet := make([]string, 0, 1)
delPrefix := deleteLS
if routingInstance != defaultW {
delPrefix = delRoutingInstances + routingInstance + " "
Expand All @@ -444,8 +443,9 @@ func delVstpVlan(vlanID, routingInstance string, deleteAll bool, clt *Client, ju
"max-age",
"system-identifier",
}
for _, line := range listLinesToDelete {
configSet = append(configSet, delPrefix+line)
configSet := make([]string, len(listLinesToDelete))
for k, line := range listLinesToDelete {
configSet[k] = delPrefix + line
}

return clt.configSet(configSet, junSess)
Expand Down
6 changes: 3 additions & 3 deletions junos/resource_vstp_vlan_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,6 @@ func readVstpVlanGroup(name, routingInstance string, clt *Client, junSess *junos
}

func delVstpVlanGroup(name, routingInstance string, deleteAll bool, clt *Client, junSess *junosSession) error {
configSet := make([]string, 0, 1)
delPrefix := deleteLS
if routingInstance != defaultW {
delPrefix = delRoutingInstances + routingInstance + " "
Expand All @@ -469,8 +468,9 @@ func delVstpVlanGroup(name, routingInstance string, deleteAll bool, clt *Client,
"system-identifier",
"vlan",
}
for _, line := range listLinesToDelete {
configSet = append(configSet, delPrefix+line)
configSet := make([]string, len(listLinesToDelete))
for k, line := range listLinesToDelete {
configSet[k] = delPrefix + line
}

return clt.configSet(configSet, junSess)
Expand Down

0 comments on commit a6515ff

Please sign in to comment.