-
Notifications
You must be signed in to change notification settings - Fork 416
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
Make unnamed volume names more unique #5779
base: main
Are you sure you want to change the base?
Conversation
- Follow a scheme similar to what we do for persistent containers. Use the first 10 characters of the SHA256 of the app host's physical path as the volume name prefix. - This is a breaking change and the only workaround is the manually specify the volume name. Fixes #5413
// Create volume name like "{sha256}-postgres-data" | ||
|
||
// Compute a short hash of the content root path to differentiate between multiple AppHost projects with similar volume names | ||
var applicationName = builder.ApplicationBuilder.Configuration["AppHost:Sha256"]![..10].ToLowerInvariant(); |
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.
As a user, how am I supposed to know which volume maps to which app in Docker Desktop?
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.
You don't know the SHA256 off the top of your head?!? I was waiting for feedback to say we should keep the assembly name as part of the prefix. I think instead of what it does today around dropping the name if the characters are invalid, we should instead remove those characters.
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.
Is there a length limit? Maybe we put the 5-10 character SHA at the end of the volume name?
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.
I think the limit is OS specific (these end up being paths). I also think we should lowercase the name.
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.
I also think we should lowercase the name.
I don't necessarily object to that. I just want to be able to understand what each volume is used for.
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.
Yeah I think we should keep the application name in here and append the SHA to disambiguate.
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.
Also you'll need to update the doc-comment to reflect whatever you end up making the format.
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.
Doc comments on internals APIs 👀
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.
Then delete it 😄
Description
Fixes #5413
Checklist
<remarks />
and<code />
elements on your triple slash comments?Microsoft Reviewers: Open in CodeFlow