-
Notifications
You must be signed in to change notification settings - Fork 535
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
Re-execute envvar and arg callbacks when restarting resources #7329
Conversation
40b15e6
to
1c0cf60
Compare
The isinitialized check isn’t needed anymore after the last dcp refactor. Resource is now initialized on every start |
Need to rewrite this against my refactor #7360 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (4)
src/Aspire.Hosting/Dcp/DcpExecutor.cs:1248
- The variable 'value' is cast to 'string' without checking if it is indeed a 'string'. This could potentially cause a runtime error. Ensure 'value' is a 'string' before casting.
var resolvedValue = value switch
src/Aspire.Hosting/Dcp/DcpExecutor.cs:1258
- The variable 'resolvedValue' is cast to 'string' without checking if it is indeed a 'string'. This could potentially cause a runtime error. Ensure 'resolvedValue' is a 'string' before casting.
specs.Add((string)resolvedValue);
src/Aspire.Hosting/Dcp/DcpExecutor.cs:1221
- [nitpick] The error message 'Failed to apply argument '{ConfigKey}'' should be more specific about which argument failed. Consider including the argument name or value in the message.
resourceLogger.LogCritical(ex, "Failed to apply argument '{ConfigKey}'. A dependency may have failed to start.", value);
src/Aspire.Hosting/Dcp/DcpExecutor.cs:1263
- [nitpick] The error message 'Failed to apply container runtime argument '{ConfigKey}'' should be more specific about which argument failed. Consider including the argument name or value in the message.
resourceLogger.LogCritical(ex, "Failed to apply container runtime argument '{ConfigKey}'. A dependency may have failed to start.", value);
1c0cf60
to
308dbcd
Compare
@davidfowl Updated. Please take a look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes a lot of sense
Where are the conflicts?? |
Oh @adamint 's change 😄 |
😄 |
308dbcd
to
3b32398
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Are these real test failures or no? |
No, #7448 |
Description
When a resource is first started by DCP it applies envvar and arg settings based on values from callbacks. Restarting a resource now reuses the same code to apply values again.
Also in this PR is a refactor of how callbacks are executed and applied. They're moved to new methods and reused between containers and executables.
Fixes #5879
Checklist
<remarks />
and<code />
elements on your triple slash comments?breaking-change
template):doc-idea
template):