I am writing an admission controller, which is responsible for starting all the containers with my version of exec say myexec.
I know, I can modify command in pod's container spec, to prefix with myexec.
But I am stuck in the case when there is no command in pod's container spec. In those cases, as per my understanding, I have to find which the entrypoint command/script of the image that container is going to load. And I need to set command as myexec entrypoint.sh.
That seems tricky and expensive since I have to inspect the image, find entrypoint, all inside the admission controller.
What i want to mention is that kubernetes already pulling image (in case if image was already pulled in previously or loaded explicitly beforehand in clusters) and having manifest on their nodes, it might be sending those entrypoint information as container config, but i am not aware how to capture those during admission.
So I am seeking some hint, trick or way that I am not aware of to achieve my goal.
PS: I can't change image configuration.