Skip to content

Commit

Permalink
Fix: Fixed URL Filtering Rule Drift (#357)
Browse files Browse the repository at this point in the history
* Fix: Fixed URL Filtering Rule Drift
  • Loading branch information
willguibr authored Jul 3, 2024
1 parent e2e77db commit 8ec000c
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 8 deletions.
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## 2.91.4 (July, 3 2024)

### Notes

- Release date: **(July, 3 2024)**
- Supported Terraform version: **v1.x**

### Bug Fix

- [PR #357](https://github.com/zscaler/terraform-provider-zia/357) - Fixed ``zia_url_filtering_rules`` drift due to attribute conversion ``validatidy_start_time`` and ``validity_end_time``.

## 2.91.3 (July, 2 2024)

### Notes

- Release date: **(July, 2 2024)**
- Supported Terraform version: **v1.x**

### Bug Fix

- [PR #356](https://github.com/zscaler/terraform-provider-zia/356) - Fixed ``zia_url_filtering_rules`` schema validation to ensure proper validation during plan and apply stages.
- [PR #356](https://github.com/zscaler/terraform-provider-zia/356) - Fixed ``zia_location_management`` drift due to missing `state` attribute in the READ function.

## 2.91.2 (July, 2 2024)

### Notes
Expand Down
6 changes: 3 additions & 3 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,14 @@ test\:integration\:zscalertwo:
build13: GOOS=$(shell go env GOOS)
build13: GOARCH=$(shell go env GOARCH)
ifeq ($(OS),Windows_NT) # is Windows_NT on XP, 2000, 7, Vista, 10...
build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/2.91.3/$(GOOS)_$(GOARCH)
build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/2.91.4/$(GOOS)_$(GOARCH)
else
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/2.91.3/$(GOOS)_$(GOARCH)
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZIA_PROVIDER_NAMESPACE)/2.91.4/$(GOOS)_$(GOARCH)
endif
build13: fmtcheck
@echo "==> Installing plugin to $(DESTINATION)"
@mkdir -p $(DESTINATION)
go build -o $(DESTINATION)/terraform-provider-zia_v2.91.3
go build -o $(DESTINATION)/terraform-provider-zia_v2.91.4

coverage: test
@echo "✓ Opening coverage for unit tests ..."
Expand Down
25 changes: 24 additions & 1 deletion docs/guides/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,33 @@ description: |-
Track all ZIA Terraform provider's releases. New resources, features, and bug fixes will be tracked here.

---
``Last updated: v2.91.2``
``Last updated: v2.91.4``

---

## 2.91.4 (July, 3 2024)

### Notes

- Release date: **(July, 3 2024)**
- Supported Terraform version: **v1.x**

### Bug Fix

- [PR #357](https://github.com/zscaler/terraform-provider-zia/357) - Fixed ``zia_url_filtering_rules`` drift due to attribute conversion ``validatidy_start_time`` and ``validity_end_time``.

## 2.91.3 (July, 2 2024)

### Notes

- Release date: **(July, 2 2024)**
- Supported Terraform version: **v1.x**

### Bug Fix

- [PR #356](https://github.com/zscaler/terraform-provider-zia/356) - Fixed ``zia_url_filtering_rules`` schema validation to ensure proper validation during plan and apply stages.
- [PR #356](https://github.com/zscaler/terraform-provider-zia/356) - Fixed ``zia_location_management`` drift due to missing `state` attribute in the READ function.

## 2.91.2 (July, 2 2024)

### Notes
Expand Down
2 changes: 1 addition & 1 deletion zia/common/version.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package common

var version = "2.91.2"
var version = "2.91.4"

// Version returns version of provider
func Version() string {
Expand Down
18 changes: 16 additions & 2 deletions zia/resource_zia_url_filtering_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,22 @@ func resourceURLFilteringRulesRead(d *schema.ResourceData, m interface{}) error
_ = d.Set("request_methods", resp.RequestMethods)

// Convert epoch time back to RFC1123 in UTC with consistent formatting
_ = d.Set("validity_start_time", time.Unix(int64(resp.ValidityStartTime), 0).UTC().Format(time.RFC1123))
_ = d.Set("validity_end_time", time.Unix(int64(resp.ValidityEndTime), 0).UTC().Format(time.RFC1123))
// _ = d.Set("validity_start_time", time.Unix(int64(resp.ValidityStartTime), 0).UTC().Format(time.RFC1123))
// _ = d.Set("validity_end_time", time.Unix(int64(resp.ValidityEndTime), 0).UTC().Format(time.RFC1123))

// Set validity_start_time only if it is not the default value
if resp.ValidityStartTime != 0 {
_ = d.Set("validity_start_time", time.Unix(int64(resp.ValidityStartTime), 0).UTC().Format(time.RFC1123))
} else {
_ = d.Set("validity_start_time", nil)
}

// Set validity_end_time only if it is not the default value
if resp.ValidityEndTime != 0 {
_ = d.Set("validity_end_time", time.Unix(int64(resp.ValidityEndTime), 0).UTC().Format(time.RFC1123))
} else {
_ = d.Set("validity_end_time", nil)
}

_ = d.Set("validity_time_zone_id", resp.ValidityTimeZoneID)
_ = d.Set("enforce_time_validity", resp.EnforceTimeValidity)
Expand Down
2 changes: 1 addition & 1 deletion zia/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package zia

// ProviderVersion is set at build-time in the release process
var ProviderVersion = "2.91.2"
var ProviderVersion = "2.91.4"

0 comments on commit 8ec000c

Please sign in to comment.