Object depending on itself causes sylvactl to crash
After some misconfiguration leading to have an unit depending on itself, sylvactl watch failed with following error:
runtime: goroutine stack exceeds 1000000000-byte limit
runtime: sp=0xc020896378 stack=[0xc020896000, 0xc040896000]
fatal error: stack overflow
This is caused by the fact that when a resource becomes ready, we request the reconciliation of its dependents using the resource spec here without checking if such dependencies would create a loop.
We should use t.GetDependencies in that place instead of relying on resource spec using DependsOn, as it will only return a list of dependents that are loop-free. Additionally it'll probably be more performant as we won't have to follow the dependency chain.
Edited by Francois Eleouet