Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

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

Merged
merged 2 commits into from
Jan 31, 2024

Conversation

g-linville
Copy link
Contributor

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

  • The title of this PR would make a good line in Acorn's Release Note's Changelog
  • The title of this PR ends with a link to the main issue being address in parentheses, like: This is a title (#1216). Here's an example
  • All relevant issues are referenced in the PR description. NOTE: don't use GitHub keywords that auto-close issues
  • Commits follow contributing guidance
  • Automated tests added to cover the changes. If tests couldn't be added, an explanation is provided in the Verification and Testing section
  • Changes to user-facing functionality, API, CLI, and upgrade impacts are clearly called out in PR description
  • PR has at least two approvals before merging (or a reasonable exception, like it's just a docs change)

Copy link
Contributor

@StrongMonkey StrongMonkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick fix! 🚀

Signed-off-by: Grant Linville <[email protected]>
@g-linville g-linville requested a review from njhale January 31, 2024 21:14
@g-linville g-linville merged commit 3964bbc into acorn-io:main Jan 31, 2024
4 checks passed
@g-linville g-linville deleted the fix-status-deleted-containers branch January 31, 2024 22:16
@sangee2004 sangee2004 added this to the Backlog milestone Jan 31, 2024
@sangee2004
Copy link
Contributor

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

@sangee2004 sangee2004 removed this from the Backlog milestone Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants