Skip to content

Commit

Permalink
fix: remove conflicts with
Browse files Browse the repository at this point in the history
  • Loading branch information
mjyocca committed Jan 25, 2024
1 parent 391ad6f commit ff1946f
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions internal/provider/resource_tfe_organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,15 @@ func resourceTFEOrganization() *schema.Resource {
},

"send_passing_statuses_for_untriggered_speculative_plans": {
Type: schema.TypeBool,
Optional: true,
Computed: true,
ConflictsWith: []string{"aggregated_commit_status_enabled"},
Type: schema.TypeBool,
Optional: true,
Computed: true,
},

"aggregated_commit_status_enabled": {
Type: schema.TypeBool,
Optional: true,
Computed: true,
ConflictsWith: []string{"send_passing_statuses_for_untriggered_speculative_plans"},
Type: schema.TypeBool,
Optional: true,
Computed: true,
},

"assessments_enforced": {
Expand Down Expand Up @@ -201,13 +199,20 @@ func resourceTFEOrganizationUpdate(d *schema.ResourceData, meta interface{}) err
options.CostEstimationEnabled = tfe.Bool(costEstimationEnabled.(bool))
}

// If send_passing_statuses_for_untriggered_speculative_plans is supplied, set it using the options struct.
if sendPassingStatusesForUntriggeredSpeculativePlans, ok := d.GetOk("send_passing_statuses_for_untriggered_speculative_plans"); ok {
options.SendPassingStatusesForUntriggeredSpeculativePlans = tfe.Bool(sendPassingStatusesForUntriggeredSpeculativePlans.(bool))
if d.HasChange("send_passing_statuses_for_untriggered_speculative_plans") {
// If send_passing_statuses_for_untriggered_speculative_plans is supplied, set it using the options struct.
if sendPassingStatusesForUntriggeredSpeculativePlans, ok := d.GetOk("send_passing_statuses_for_untriggered_speculative_plans"); ok {
options.SendPassingStatusesForUntriggeredSpeculativePlans = tfe.Bool(sendPassingStatusesForUntriggeredSpeculativePlans.(bool))
} else {
options.SendPassingStatusesForUntriggeredSpeculativePlans = tfe.Bool(false)
}
}

if aggregatedCommitStatusEnabled, ok := d.GetOk("aggregated_commit_status_enabled"); ok {
options.AggregatedCommitStatusEnabled = tfe.Bool(aggregatedCommitStatusEnabled.(bool))
if d.HasChange("aggregated_commit_status_enabled") {
// If aggregated_commit_status_enabled is supplied, set it using the options struct.
if aggregatedCommitStatusEnabled, ok := d.GetOk("aggregated_commit_status_enabled"); ok {
options.AggregatedCommitStatusEnabled = tfe.Bool(aggregatedCommitStatusEnabled.(bool))
}
}

// If assessments_enforced is supplied, set it using the options struct.
Expand Down

0 comments on commit ff1946f

Please sign in to comment.