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

Allow deleted containers to be restarted #7282

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Jan 28, 2025

Description

Fixes #5977

I tested that a container resource with a deleted container will successfully restart.

I think there is a follow up improvement in DCP to give a better state than Unknown in this situation.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

@JamesNK JamesNK added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Jan 28, 2025
@JamesNK JamesNK requested a review from mitchdenny as a code owner January 28, 2025 02:34
@davidfowl
Copy link
Member

Why not fix in dcp? Is this podman only? It only applies for containers right

@JamesNK
Copy link
Member Author

JamesNK commented Jan 28, 2025

What would the fix be in DCP? If a container is deleted in container tooling then DCP automatically recreates the container? That feels a little too magical to me.

Ideally I think DCP reports a clear status, and then someone has the option to press start on the resource if they want. If DCP has a new status then app host will need to react to it. Basically the exact same thing I did here with Unknown.

Copy link
Member

@karolz-ms karolz-ms left a comment

Choose a reason for hiding this comment

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

Exposing "Start" for Containers in Unknown state a good bet in general. In future might have a specific state for Container objects that had corresponding Docker/Podman containers deleted, but that is not really a mainline scenario.

@JamesNK JamesNK merged commit 648f967 into main Jan 28, 2025
9 checks passed
@JamesNK JamesNK deleted the jamesnk/support-start-of-deleted-containers branch January 28, 2025 04:57
@JamesNK
Copy link
Member Author

JamesNK commented Jan 28, 2025

Follow up issue to improve state from DCP: #7287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication
Projects
None yet
3 participants