HomePhorge

(#6907) Allow providers to be selected in the run they become suitable
70114e97238eUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(#6907) Allow providers to be selected in the run they become suitable

Previously, if a resource did not specify its provider, it would be assigned
the most appropriate suitable provider (typically the default). If no provider
was suitable, the run would fail before it even began. This meant that a
provider which was going to have its requirements delivered during the run
could not be used in that run.

In the case that an unsuitable provider was explicitly specified, this would
only work in certain conditions. Suitability was lazily checked, which meant
the resources installing the provider had to come before the resources using
it. If this weren't true (because the dependencies weren't specified), those
resources would still fail.

Now, we will instead *wait* for the provider to become suitable. Similarly, if
no provider is specified, we wait for a suitable provider to become available.

We accomplish this by deferring unsuitable resources when they are encountered.
Once we are out of suitable resources, we re-enqueue our previously-unsuitable
resources and check them again. If some are now suitable, we evaluate them as
normally, deferring the rest. If all our deferred resources are still deferred,
they all fail, and we continue on with their dependents (which will all be
marked as skipped due to failed dependencies).

This allows providers to be used in the same run as resources using them,
without needing to specify any dependencies between resources using the
provider and resources installing the provider. Naturally, if the resources
installing the provider depend on resources using the provider, the run cannot
succeed.

Details

Provenance
Nick Lewis <nick@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPUa0ee5c70c900: maint: Fix incorrect whitespace
Branches
Unknown
Tags
Unknown

Event Timeline

Nick Lewis <nick@puppetlabs.com> committed rPU70114e97238e: (#6907) Allow providers to be selected in the run they become suitable (authored by Nick Lewis <nick@puppetlabs.com>).Nov 29 2011, 2:11 AM