class Chef::ProviderResolver

Provider Resolution

Provider resolution is the process of taking a Resource object and an action, and determining the Provider class that should be instantiated to handle the action.

If the resource has its ‘provider` set, that is used.

Otherwise, we take the lists of Providers that have registered as providing the DSL through ‘provides :dsl_name, <filters>` or `Chef.set_resource_priority_array :dsl_name, <filters>`. We filter each list of Providers through:

  1. The filters it was registered with (such as ‘os: ’linux’‘ or `platform_family: ’debian’‘)

  2. ‘provides?(node, resource)`

  3. ‘supports?(resource, action)`

Anything that passes the filter and returns ‘true` to provides and supports, is considered a match. The first matching Provider in the *most recently registered list* is selected and returned.