(#22229) Ensure generated resources contained

The generated resources were left out in the cold with respect to
containers: they had none at all. This changes that to make sure that the
generated resources (via #generate and #eval_generate) have the same
container as the resource that generated them.