Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid diffs due to order of elements returned by the controller #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bltavares
Copy link
Contributor

@bltavares bltavares commented Mar 17, 2019

The network and member resource use a couple of settings which could be
defined multiple times.

For example: the assigned ips on a member could change the order, while
the semantic means the same.

The provider was using a schema.ListType, which according to the
documentation is an ordered list of elements, where the order
matter.

On those resource seetings, the order is not relevant, as they are
sematically equivalent. There is a schema.SetType which provides an
unordered collection of settings, and grants the same order given the
same settings.

This commit changes the schema of those resources to use
schema.SetType instead of schema.ListType to avoid diff loops
depending on the sorting of the response from the API.

The network and member resource use a couple of settings which could be
defined multiple times.

For example: the assigned ips on a member could change the order, while
the semantic means the same.

The provider was using a `schema.ListType`, which according to the
documentation is an *ordered* list of elements, where the order
matter.

On those resource seetings, the order is not relevant, as they are
sematically equivalent. There is a `schema.SetType` which provides an
*unordered* collection of settings, and grants the same order given the
same settings.

This commit changes the schema of those resources to use
`schema.SetType` instead of `schema.ListType` to avoid diff loops
depending on the sorting of the response from the API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant