-
Notifications
You must be signed in to change notification settings - Fork 256
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
Provide error message when allow_stdio_access creates and undecideable error #1662
Provide error message when allow_stdio_access creates and undecideable error #1662
Conversation
…e error If two containers are indistinguishable at create_container or exec_external time except for their `allow_stdio_access` value, then we are unable to proceed as we don't know if access should be allowed or not. Prior to this commit, no error message at all was displayed when this was hit making it almost impossible for someone not "in the know" to diagnose. This first version gives a very simple error message that will be improved with more information in later commits. Signed-off-by: Sean T. Allen <seanallen@microsoft.com>
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.
Minor questions below
input.rule == "create_container" | ||
|
||
not container_started | ||
possible_containers := [container | |
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.
it seems like a lot of the logic here is also used in create_container
. Can we define a function that will return the matching containers (minus stdio) and reuse it here?
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.
Yes but this was intentional as when we make this a better error message (coming in the not so distant future) this might no longer share all the logic. So I intentionally decided to not do that now given additional changes coming soon.
If you want it refactored now knowing that it might be undone when this is addressed further in March, I can do it. If come the changes in March, these still are rather similar, I was going to do the refactor to remove duplication then.
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.
Got it.
errors["external processes only distinguishable by allow_stdio_access"] { | ||
input.rule == "exec_external" | ||
|
||
possible_processes := [process | |
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.
same here.
If two containers are indistinguishable at create_container or exec_external time except for their
allow_stdio_access
value, then we are unable to proceed as we don't know if access should be allowed or not.Prior to this commit, no error message at all was displayed when this was hit making it almost impossible for someone not "in the know" to diagnose.
This first version gives a very simple error message that will be improved with more information in later commits.
Signed-off-by: Sean T. Allen seanallen@microsoft.com