Skip to content

Commit

Permalink
fix: boolean attribute checks
Browse files Browse the repository at this point in the history
  • Loading branch information
DXTimer committed Sep 18, 2023
1 parent 212f913 commit b2b89b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/framework/resources/registered_domain/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func (r *RegisteredDomainResource) Update(ctx context.Context, req resource.Upda
planData.RegistrantChange = stateData.RegistrantChange
}

if planData.AutoRenewEnabled.ValueBool() != stateData.AutoRenewEnabled.ValueBool() {
if !(planData.AutoRenewEnabled.IsUnknown() || planData.AutoRenewEnabled.IsNull()) && planData.AutoRenewEnabled.ValueBool() != stateData.AutoRenewEnabled.ValueBool() {

diags := r.setAutoRenewal(ctx, planData)
if diags.HasError() {
Expand All @@ -207,7 +207,7 @@ func (r *RegisteredDomainResource) Update(ctx context.Context, req resource.Upda
}
}

if planData.WhoisPrivacyEnabled.ValueBool() != stateData.WhoisPrivacyEnabled.ValueBool() {
if !(planData.WhoisPrivacyEnabled.IsUnknown() || planData.WhoisPrivacyEnabled.IsNull()) && planData.WhoisPrivacyEnabled.ValueBool() != stateData.WhoisPrivacyEnabled.ValueBool() {

diags := r.setWhoisPrivacy(ctx, planData)
if diags.HasError() {
Expand All @@ -216,7 +216,7 @@ func (r *RegisteredDomainResource) Update(ctx context.Context, req resource.Upda
}
}

if planData.DNSSECEnabled.ValueBool() != stateData.DNSSECEnabled.ValueBool() {
if !(planData.DNSSECEnabled.IsUnknown() || planData.DNSSECEnabled.IsNull()) && planData.DNSSECEnabled.ValueBool() != stateData.DNSSECEnabled.ValueBool() {

diags := r.setDNSSEC(ctx, planData)
if diags.HasError() {
Expand All @@ -225,7 +225,7 @@ func (r *RegisteredDomainResource) Update(ctx context.Context, req resource.Upda
}
}

if planData.TransferLockEnabled.ValueBool() != stateData.TransferLockEnabled.ValueBool() {
if !(planData.TransferLockEnabled.IsUnknown() || planData.TransferLockEnabled.IsNull()) && planData.TransferLockEnabled.ValueBool() != stateData.TransferLockEnabled.ValueBool() {

diags := r.setTransferLock(ctx, planData)
if diags.HasError() {
Expand Down

0 comments on commit b2b89b3

Please sign in to comment.