acorn-io / runtime

A simple application deployment framework built on Kubernetes
https://docs.acorn.io/
Apache License 2.0
1.14k stars 102 forks source link

fix: remove resolvedOfferings, defaults, and scheduling for containers not defined in app #2468

Closed g-linville closed 5 months ago

g-linville commented 5 months ago

We discovered this bug earlier today while working on something else. If you do acorn update --image <image> <app name>, and containers that were previously defined in the app no longer are, the resolved offerings, defaults, and scheduling information would still be present in the app's status for the old containers, even though they are not in the app anymore. This PR adds logic to delete containers from these maps when they no longer exist in the app. I also added new unit tests that check for this.

Checklist

sangee2004 commented 5 months ago

Tested with - v0.10.1-rc1-21-g3964bbc9+3964bbc9

  1. Deploy app with image that was built from Acornfile that has 2 containers ( con1 and con2)
  2. Update app with an image that was built from Acornfile that has only 1 container (con1) After update , When examining app with acorn app -o json , resolvedOfferings and defaults have info for only con1 (there is no info about con2

When examining appinstance with akubectl get appinstances -o json , resolvedOfferings , defaults and scheduling have info for only con1 (there is no info about con2