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

oci-umount: do not error out if the config file is missing #1

Merged

Conversation

giuseppe
Copy link
Member

@giuseppe giuseppe commented Jun 6, 2017

When the configuration file is missing, just raise a warning instead of
giving an error.

Closes: https://github.com/rhatdan/oci-umount/issues/2

Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com

When the configuration file is missing, just raise a warning instead of
giving an error.

Closes: https://github.com/rhatdan/oci-umount/issues/2

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@rhvgoyal
Copy link
Collaborator

rhvgoyal commented Jun 7, 2017

How did you run into this? Somebody removed the config file? It should be shipped with the package.

@rhvgoyal
Copy link
Collaborator

rhvgoyal commented Jun 7, 2017

Having said that, warning when config file is missing sounds reasonable.

LGTM

@giuseppe
Copy link
Member Author

giuseppe commented Jun 7, 2017

we encountered this issue while running Docker in a system container and /etc coming from the host. We fixed it in the container as we copy the file to the host now, but I thought it would still be good to not error out when the conf file is missing.

/cc @ashcrow

@rhatdan
Copy link
Member

rhatdan commented Jun 7, 2017

LGTM

@rhatdan rhatdan merged commit d7740ad into containers:master Jun 7, 2017
@rhvgoyal
Copy link
Collaborator

rhvgoyal commented Jun 7, 2017

Now thinking more about it. Very fact that it was error you noticed it and fixed it by copying file to host. If it was just a warning, nobody would have noticed it in the flood of messages. And much later somebody would have complained that hey mounts points are leaking and oci-umount is not working. So may be making it error again makes more sense?

@ashcrow
Copy link
Contributor

ashcrow commented Jun 7, 2017

@rhvgoyal Interesting. If docker should indeed fail if the file doesn't exist I agree, though I'd suggest a more verbose error message. When I noticed the message it seemed more like "I can't find this file so I can't start" rather than "I must have this file else docker won't work correctly". If that's the case I don't mind updating our container Dockerfiles as well submitting a PR with an updated error message.

@rhvgoyal
Copy link
Collaborator

rhvgoyal commented Jun 7, 2017

@ashcrow Whether docker works correctly without this file or not depends on how docker is being used. If people are using volume mounts like "-v /:/host" for containers, then there is a chance that docker will not work correctly for container removal.

I am not sure about using "must" keyword. I think its more a sanity check for the oci-umount plugin. And if a sanity check improves the probability of user having right configuration, I am up for it.

OTOH, what's the use case for making this a warning (instead of error). Where is that useful? If we don't have a good use case, I would say, just revert this PR and let the code be as it is.

@ashcrow
Copy link
Contributor

ashcrow commented Jun 7, 2017

@rhvgoyal I'm OK with a revert but I do feel pretty strongly on having a better error message. I'd say, with this new information, the use case for a warning changes and would be that oci-umount is not required, but may be used for sanity. Letting the administrator know that the file is missing is helpful. However, failing on a non required file is confusing.

I think the alternate solution is reverting and updating the error message to note that the file must exist to run docker (though nothing is done to make sure the file has content).

@rhvgoyal
Copy link
Collaborator

rhvgoyal commented Jun 7, 2017

@ashcrow change error message and generate a PR if you like. But I am not sure how it is more helpful if I say File foo is required for sanity and its missing instead of Failed to open file foo, its missing.

In both the cases admin comes to know that docker is looking for a file which is missing.

@ashcrow
Copy link
Contributor

ashcrow commented Jun 7, 2017

@rhvgoyal Agreed. I'd just like to speed up the time 😄 .

👍 on revert. Will sent a PR with an updated message.

@rhvgoyal
Copy link
Collaborator

@ashcrow hey, did you generate a PR reverting this?

@rhvgoyal
Copy link
Collaborator

@giuseppe this PR changes pr_pwarning() to LOG_INFO, instead of LOG_WARNING. That's just wrong.

@ashcrow
Copy link
Contributor

ashcrow commented Oct 27, 2017

@rhvgoyal This is where I reverted some of this: #4

@rhvgoyal
Copy link
Collaborator

Ok, I see that pr_pwarning() is logging as LOG_INFO. I will fix it. This should have been reverted too.

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.

None yet

4 participants