Skip to content

Commit

Permalink
Merge pull request #988 from citrix/route
Browse files Browse the repository at this point in the history
Updated route Resource
  • Loading branch information
sumanth-lingappa authored Jan 30, 2023
2 parents fe0abc8 + ffb99c7 commit 90b7d5f
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions citrixadc/resource_citrixadc_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"fmt"
"log"
"net/url"
"strings"
)

func resourceCitrixAdcRoute() *schema.Resource {
Expand Down Expand Up @@ -161,16 +162,22 @@ func readRouteFunc(d *schema.ResourceData, meta interface{}) error {
return nil
}

idSlice := strings.SplitN(routeName, "_", 3)

network := idSlice[0]
netmask := idSlice[1]
gateway := idSlice[2]

foundIndex := -1
for i, route := range dataArray {
match := true
if route["network"] != d.Get("network").(string) {
if route["network"] != network {
match = false
}
if route["netmask"] != d.Get("netmask").(string) {
if route["netmask"] != netmask {
match = false
}
if route["gateway"] != d.Get("gateway").(string) {
if route["gateway"] != gateway {
match = false
}
if val, ok := d.GetOk("ownergroup"); ok {
Expand Down

0 comments on commit 90b7d5f

Please sign in to comment.