terraform-provider-jamfpro icon indicating copy to clipboard operation
terraform-provider-jamfpro copied to clipboard

Smart Computer Group Logic

Open smithjw opened this issue 9 months ago • 16 comments

I'm having a look at the recent changes to the Computer Group resource and curious about the logic behind some of the validation.

Within computergroups_state.go, why are setting the computers attribute in the state if it's a Smart Group? Regardless of the site that a Smart Group belongs to, if it's a Smart Group (even with no criteria), you should not be able to set any computers objects. https://github.com/deploymenttheory/terraform-provider-jamfpro/blob/a7dd3b0cc3245914d12d82dca655d5e259f57d5e/internal/endpoints/computergroups/computergroups_state.go#L54-L67

In a similar vein, the validation within computergroups_data_validation.go also checks for both the smart flag and if a site is set which currently errors out when site is null (which is the case for instances that don't use sites at all)

https://github.com/deploymenttheory/terraform-provider-jamfpro/blob/a7dd3b0cc3245914d12d82dca655d5e259f57d5e/internal/endpoints/computergroups/computergroups_data_validation.go#L24-L34

smithjw avatar May 21 '24 05:05 smithjw