Skip to content

Commit

Permalink
Fix: dns filtering profile tests (Twingate#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmanilo authored Aug 27, 2024
1 parent 63c65a5 commit 3cb9dbe
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions twingate/internal/provider/resource/dns-filtering-profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,14 @@ func (r *dnsFilteringProfile) Read(ctx context.Context, req resource.ReadRequest

profile, err := r.client.ReadDNSFilteringProfile(ctx, state.ID.ValueString())

if !convertBoolDefaultTrue(state.AllowedDomains.Attributes()[attr.IsAuthoritative]) {
profile.AllowedDomains = convertDomains(state.AllowedDomains)
}
if profile != nil {
if !convertBoolDefaultTrue(state.AllowedDomains.Attributes()[attr.IsAuthoritative]) {
profile.AllowedDomains = convertDomains(state.AllowedDomains)
}

if !convertBoolDefaultTrue(state.DeniedDomains.Attributes()[attr.IsAuthoritative]) {
profile.DeniedDomains = convertDomains(state.DeniedDomains)
if !convertBoolDefaultTrue(state.DeniedDomains.Attributes()[attr.IsAuthoritative]) {
profile.DeniedDomains = convertDomains(state.DeniedDomains)
}
}

r.helper(ctx, profile, &state, &resp.State, &resp.Diagnostics, err, operationRead)
Expand Down

0 comments on commit 3cb9dbe

Please sign in to comment.