// readDiff returns the planned change for a particular resource instance
// object.
readDiff returns the planned change for a particular resource instance
object.
// readDiff returns the planned change for a particular resource instance // object .
func (n *NodeAbstractResourceInstance) readDiff(ctx EvalContext, providerSchema *ProviderSchema) (*plans.ResourceInstanceChange, error) {
	changes := ctx.Changes()
	addr := n.ResourceInstanceAddr()
	schema, _ := providerSchema.SchemaForResourceAddr(addr.Resource.Resource)
	if schema == nil {
		return nil, fmt.Errorf("provider does not support resource type %q", addr.Resource.Resource.Type)
	}
	gen := states.CurrentGen
	csrc := changes.GetResourceInstanceChange(addr, gen)
	if csrc == nil {
		log.Printf("[TRACE] EvalReadDiff: No planned change recorded for %s", n.Addr)
		return nil, nil
	}
	change, err := csrc.Decode(schema.ImpliedType())
	if err != nil {
		return nil, fmt.Errorf("failed to decode planned changes for %s: %s", n.Addr, err)
	}
	log.Printf("[TRACE] EvalReadDiff: Read %s change from plan for %s", change.Action, n.Addr)
	return change, nil
}
func ( n * NodeAbstractResourceInstance ) readDiff ( ctx EvalContext , providerSchema * ProviderSchema ) ( * plans . ResourceInstanceChange , error ) { changes := ctx . Changes ( ) addr := n . ResourceInstanceAddr ( ) schema , _ := providerSchema . SchemaForResourceAddr ( addr . Resource . Resource ) if schema == nil { return nil , fmt . Errorf ( " " , addr . Resource . Resource . Type ) } gen := states . CurrentGen csrc := changes . GetResourceInstanceChange ( addr , gen ) if csrc == nil { log . Printf ( " " , n . Addr ) return nil , nil } change , err := csrc . Decode ( schema . ImpliedType ( ) ) if err != nil { return nil , fmt . Errorf ( " " , n . Addr , err ) } log . Printf ( " " , change . Action , n . Addr ) return change , nil }
readDiff returns the planned change for a particular resource instance
object.
readDiff returns the planned change for a particular resource instance object .
// Should be caught during validation, so we don't bother with a pretty error here