Skip to content

Commit

Permalink
Fix managed certificate existence check (#485)
Browse files Browse the repository at this point in the history
Co-authored-by: aviv.yaari <[email protected]>
  • Loading branch information
Aviv-Yaari and avivyaari-imperva authored Dec 11, 2024
1 parent 764cb9a commit 3faa55b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion incapsula/resource_site_domain_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ func resourceDomainRead(d *schema.ResourceData, m interface{}) error {

domains := &schema.Set{F: getHashFromDomain}
for _, v := range siteDomainDetailsDto.Data {
if v.AutoDiscovered == true || (d.Get("managed_certificate_settings_id") == "" && v.MainDomain == true) { //we ignore the main and auto discovered domains
managedCertSettingsID := d.Get("managed_certificate_settings_id")
hasNoSiteCert := managedCertSettingsID == "" || managedCertSettingsID == nil
if v.AutoDiscovered == true || (hasNoSiteCert && v.MainDomain == true) { //we ignore the main and auto discovered domains
continue
}
domain := map[string]interface{}{}
Expand Down

0 comments on commit 3faa55b

Please sign in to comment.