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

Sort prestage_installed_profile_ids in state

Open w0de opened this issue 5 months ago • 2 comments

Jamf is using some esoteric sort order for the IDs returned by GET api/v3/computer-prestages/{id}. It's neither string nor integer sorting. It is also not the order match the order specified when the prestage was created/last updated, nor the order of the sorted PayloadTypes.

It isn't random - my erroneous diffs are always the same, after creation or update - but it is based on some metadata which I've been unable to identify.

For example:

      ~ prestage_installed_profile_ids        = [
          + "82",
            "119",
            "12",
          - "82",
          - "19",
            "84",
          - "164",
          + "19",
            "85",
          + "164",
        ]

Therefore I humbly ask that the provider starts sorting the IDs in state. This will allow operators to suppress the diff by sorting them in their config. (We can't use a DiffSuppressFunc here, as - even when it works, which I'm unsure it does - only string values are supported. This is of course an array value.)

w0de avatar Sep 10 '24 01:09 w0de