Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add handling for modify events where the image changes #214

Closed
thomastaylor312 opened this issue Apr 23, 2020 · 3 comments
Closed

Add handling for modify events where the image changes #214

thomastaylor312 opened this issue Apr 23, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@thomastaylor312
Copy link
Member

For 0.2 we are only handling modify events where the pod is marked for termination. We need to implement functionality for stopping the old "container" and starting a new one when spec.containers[*].image or spec.initContainers[*].image change

@thomastaylor312 thomastaylor312 added the enhancement New feature or request label Apr 23, 2020
@thomastaylor312 thomastaylor312 added this to the 0.3.0 milestone Apr 23, 2020
@Haegi
Copy link

Haegi commented May 23, 2020

Is there a recommended way to find out whether the image has changed or not.
Unfortunately, .image holds the new image immediately after the modification. That makes it hard to find out whether the image has changed.
Would it be a good solution to introduce a new pod field, which holds the current images running in the pod?

@thomastaylor312
Copy link
Member Author

Yeah, I wasn't sure on the best way to do this. client-go on the update method passes the old and the new object, but the kube crate doesn't. I think the ideal option is to add support for that to the kube crate, but that isn't a requirement for this feature.

I think we should probably just keep an in-memory map of any pods and their current images for now. A stretch goal would be to only keep track of bare pods (as other pods created from controllers just delete the pods and create new ones)

@bacongobbler
Copy link
Collaborator

I believe this has now been implemented with the state machine refactor. Changing the container image triggers a re-pull with the new image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants