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

fix filtering rule reordering #180

Merged
merged 5 commits into from
Feb 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
fix timeout functions
  • Loading branch information
willguibr committed Feb 11, 2023
commit 2bb2511cde2d70f46e8762ca19af297b1f710a8b
4 changes: 2 additions & 2 deletions zia/resource_zia_dlp_web_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ func resourceDlpWebRules() *schema.Resource {
Update: resourceDlpWebRulesUpdate,
Delete: resourceDlpWebRulesDelete,
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(10 * time.Minute),
Update: schema.DefaultTimeout(10 * time.Minute),
Create: schema.DefaultTimeout(20 * time.Minute),
Update: schema.DefaultTimeout(20 * time.Minute),
},
Importer: &schema.ResourceImporter{
State: func(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) {
Expand Down
6 changes: 3 additions & 3 deletions zia/resource_zia_firewall_filtering_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ func resourceFirewallFilteringRules() *schema.Resource {
Update: resourceFirewallFilteringRulesUpdate,
Delete: resourceFirewallFilteringRulesDelete,
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(10 * time.Minute),
Update: schema.DefaultTimeout(10 * time.Minute),
Create: schema.DefaultTimeout(20 * time.Minute),
Update: schema.DefaultTimeout(20 * time.Minute),
},
Importer: &schema.ResourceImporter{
State: func(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) {
Expand Down Expand Up @@ -336,7 +336,7 @@ func resourceFirewallFilteringRulesUpdate(d *schema.ResourceData, m interface{})
_, err := zClient.filteringrules.Update(id, &req)
if err != nil {
if strings.Contains(err.Error(), "INVALID_INPUT_ARGUMENT") {
time.Sleep(time.Second * time.Duration(req.Order))
time.Sleep(time.Second * time.Duration(req.Order+1))
log.Printf("[INFO] Updating firewall filtering rule ID: %v, got INVALID_INPUT_ARGUMENT\n", id)
return resource.RetryableError(errors.New("expected resource to be updated but was not"))
}
Expand Down
6 changes: 3 additions & 3 deletions zia/resource_zia_url_filtering_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ func resourceURLFilteringRules() *schema.Resource {
Update: resourceURLFilteringRulesUpdate,
Delete: resourceURLFilteringRulesDelete,
Timeouts: &schema.ResourceTimeout{
Create: schema.DefaultTimeout(10 * time.Minute),
Update: schema.DefaultTimeout(10 * time.Minute),
Create: schema.DefaultTimeout(20 * time.Minute),
Update: schema.DefaultTimeout(20 * time.Minute),
},
Importer: &schema.ResourceImporter{
State: func(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error) {
Expand Down Expand Up @@ -341,7 +341,7 @@ func resourceURLFilteringRulesUpdate(d *schema.ResourceData, m interface{}) erro
_, _, err := zClient.urlfilteringpolicies.Update(id, &req)
if err != nil {
if strings.Contains(err.Error(), "INVALID_INPUT_ARGUMENT") {
time.Sleep(time.Second * time.Duration(req.Order))
time.Sleep(time.Second * time.Duration(req.Order+1))
log.Printf("[INFO] Updating url filtering rule ID: %v, got INVALID_INPUT_ARGUMENT\n", id)
return resource.RetryableError(errors.New("expected resource to be updated but was not"))
}
Expand Down