-
Notifications
You must be signed in to change notification settings - Fork 4
Connection check fails on insufficient privileges #73
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
Conversation
GabyUnalaq
left a comment
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.
The changes do not fix the issue.
How I tested
I've run the hello_ankaios example with a changed manifest:
examples/manifest.yaml:
...
controlInterfaceAccess:
allowRules:
- type: StateRule
operation: ReadWrite
filterMask:
- "desiredState.workloads"
- "workloadStates"
...And run it in dev mode: ./run_example.sh hello_ankaios dev
Output before:
Output after
Suggestions
By implementing the suggestion from @krucod3 from the issue description, the second line is deleted, but the first one remains: Error while trying to get the state: Access denied.
Hint: This line comes from the Ankaios.get_state method, and this should be suppressed as well in this case.
|
There should not be any message regarding the access denied. |
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.
There are 2 cases for when the check if successful:
- The CompleteState with only the apiVersion is returned, thus the connection is fine.
- The request is blocked due to not enough privileges, thus the connection is fine.
In all other cases (ConnectionClosed or ProtocolException), the connection check fails. Because the flag never gets set to True if the apiVersion is successfully returned, the error line in get state for subsequent requests never get's logged in case of a privilege issue.
GabyUnalaq
left a comment
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.
LGTM 👍



Issues: #69
Definition of Done
The PR shall be merged only if all items mentioned in CONTRIBUTING.md have been followed. In case an item is not applicable as described, please provide a short explanation in the description.