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

service: fix deleting volumes for services never started before #955

Merged
merged 1 commit into from
May 13, 2019

Conversation

ilgooz
Copy link
Contributor

@ilgooz ilgooz commented May 13, 2019

fixes #931

@ilgooz ilgooz requested a review from a team May 13, 2019 07:47
if service is never started before, data volume won't be created and Docker Engine will return with the not found error. therefore, we can safely ignore it.

fixes #931.
if err := c.DeleteVolume(source); err != nil {
// if service is never started before, data volume won't be created and Docker Engine
// will return with the not found error. therefore, we can safely ignore it.
if err := c.DeleteVolume(source); err != nil && !client.IsErrNotFound(err) {
Copy link
Member

Choose a reason for hiding this comment

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

could be done directly in the DeleteVolume function that ignores the error to avoid the dependency with docker but it's fine like that too

@antho1404 antho1404 merged commit cac1663 into dev May 13, 2019
@antho1404 antho1404 deleted the fix/service-delete branch May 13, 2019 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

can't find volume after redeployed services
3 participants