Closed kfox1111 closed 8 years ago
Sure,
i think entrypoint should first check if it is inside init-container, if so exit(0). Otherwise exit(1).
Until this feature is not implemented. Please use COMMAND="echo Done".
Dear @PiotrProkop, In order to implement easy check, whether instance is init-container or not, user needs to pass container-name via env. I think it's not generic approach. So what I'd suggest is to change return code to 0 and log it as a warning. Yours sincerely Daniel
Merged.
Closing due to #13 .
I'd like to use kubernetes-entrypoint in a k8s init-container instead of embededing it in directly into each regular container. This allows unmodified containers to be used, and also allows you to restrict k8s service tokens to just the init container, enhancing security.
I think this would work well, but the current implementation in kubernetes-entrypoint.go looks to fail if command is empty:
if comm = env.SplitEnvToList("COMMAND", " "); len(comm) == 0 { logger.Error.Printf("COMMAND env is empty") os.Exit(1) }
Can a feature be added to allow it to simply os.Exit(0) after deps are resolved when set so it can be used as an init-container?