Skip to content

Commit

Permalink
fix: Fixed application segment match_style validation
Browse files Browse the repository at this point in the history
  • Loading branch information
willguibr committed Aug 23, 2024
1 parent 9f24683 commit b930807
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 3.32.3 (August, 22 2024)

### Notes

- Release date: **(August, 22 2024)**
- Supported Terraform version: **v1.x**

### Bug Fixes
- [PR #476](https://github.com/zscaler/terraform-provider-zpa/pull/476) - Fixed validation for the `match_style` attribute in the resource `zpa_application_segment`.

## 3.32.2 (August, 16 2024)

### Notes
Expand Down
6 changes: 3 additions & 3 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ test\:integration\:zpa:
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/$(ZPA_PROVIDER_NAMESPACE)/3.32.2/$(GOOS)_$(GOARCH)
build13: DESTINATION=$(APPDATA)/terraform.d/plugins/$(ZPA_PROVIDER_NAMESPACE)/3.32.3/$(GOOS)_$(GOARCH)
else
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZPA_PROVIDER_NAMESPACE)/3.32.2/$(GOOS)_$(GOARCH)
build13: DESTINATION=$(HOME)/.terraform.d/plugins/$(ZPA_PROVIDER_NAMESPACE)/3.32.3/$(GOOS)_$(GOARCH)
endif
build13: fmtcheck
@echo "==> Installing plugin to $(DESTINATION)"
@mkdir -p $(DESTINATION)
go build -o $(DESTINATION)/terraform-provider-zpa_v3.32.2
go build -o $(DESTINATION)/terraform-provider-zpa_v3.32.3

vet:
@echo "==> Checking source code against go vet and staticcheck"
Expand Down
12 changes: 11 additions & 1 deletion docs/guides/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,20 @@ Track all ZPA Terraform provider's releases. New resources, features, and bug fi

---

``Last updated: v3.32.2``
``Last updated: v3.32.3``

---

## 3.32.3 (August, 22 2024)

### Notes

- Release date: **(August, 22 2024)**
- Supported Terraform version: **v1.x**

### Bug Fixes
- [PR #476](https://github.com/zscaler/terraform-provider-zpa/pull/476) - Fixed validation for the `match_style` attribute in the resource `zpa_application_segment`.

## 3.32.2 (August, 16 2024)

### Notes
Expand Down
15 changes: 0 additions & 15 deletions zpa/resource_zpa_application_segment.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package zpa

import (
"context"
"fmt"
"log"
"strconv"
Expand All @@ -24,20 +23,6 @@ func resourceApplicationSegment() *schema.Resource {
Read: resourceApplicationSegmentRead,
Update: resourceApplicationSegmentUpdate,
Delete: resourceApplicationSegmentDelete,
CustomizeDiff: func(ctx context.Context, d *schema.ResourceDiff, meta interface{}) error {
// Get the value of the ip_anchored attribute
ipAnchored := d.Get("ip_anchored").(bool)

// Check if match_style is set
if matchStyle, ok := d.GetOk("match_style"); ok {
// If ip_anchored is true and match_style is set, return an error
if ipAnchored && matchStyle != "" {
return fmt.Errorf("match_style cannot be set when ip_anchored is true")
}
}

return nil
},
Importer: &schema.ResourceImporter{
State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
client := meta.(*Client)
Expand Down

0 comments on commit b930807

Please sign in to comment.