It's not a pipeline responsibility to do anything with a controller or agent, especially to update and restart it. It's a job for an external configuration management tool. A job can't run without the controller, so your idea is impossible to implement.