Updates to the telepresence-agents configmap may well trigger a roll-out of the corresponding workload. That roll-out will trigger new calls to the injector. If the API is fast enough, this will result in a loop that is similar to a recursion. The result is a large number of created pods that eventually must be deleted.
This PR removes the update of the configmap from the injector so that this loop is prevented.
This PR also add the needed watchers and event handlers that take care of the special telepresence.getambassador.io/inject-traffic-agent annotation, and ensure that the traffic-agent is injected or removed in accordance with its setting.
Integration tests that uses 25 service/deployment combos with the annotation enabled was added to ensure correct behavior for the traffic-manager for the cases when the traffic-manager is installed before the deployments or installed/updated when they were already present.
Updates to the telepresence-agents configmap may well trigger a roll-out of the corresponding workload. That roll-out will trigger new calls to the injector. If the API is fast enough, this will result in a loop that is similar to a recursion. The result is a large number of created pods that eventually must be deleted.
This PR removes the update of the configmap from the injector so that this loop is prevented.
This PR also add the needed watchers and event handlers that take care of the special
telepresence.getambassador.io/inject-traffic-agent
annotation, and ensure that the traffic-agent is injected or removed in accordance with its setting.Integration tests that uses 25 service/deployment combos with the annotation enabled was added to ensure correct behavior for the traffic-manager for the cases when the traffic-manager is installed before the deployments or installed/updated when they were already present.