• Martin Atkins's avatar
    core: Eliminate NodePlannableResource indirection · b9b39e96
    Martin Atkins authored
    We previously did two levels of DynamicExpand to go from ConfigResource to
    AbsResource and then from AbsResource to AbsResourceInstance.
    
    We'll now do the full expansion from ConfigResource to AbsResourceInstance
    in a single DynamicExpand step inside nodeExpandPlannableResource.
    
    The new approach is essentially functionally equivalent to the old except
    that it fixes a bug in the previous implementation: we will now call
    checkState.ReportCheckableObjects only once for the entire set of
    instances for a particular resource, which is what the checkable objects
    infrastructure expects so that it can always mention all of the checkable
    objects in the check report even if we bail out partway through due to
    a downstream error.
    
    This is essentially the same code but now turned into additional methods
    on nodeExpandPlannableResource instead of having the extra graph node
    type. This has the further advantage of this now being straight-through
    code with standard control flow, instead of the unusual inversion of
    control we were doing before bouncing in and out of different Execute and
    DynamicExpand implementations to get this done.
    b9b39e96