-
Notifications
You must be signed in to change notification settings - Fork 594
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
many: add support for user daemons in "snapctl services" #13806
many: add support for user daemons in "snapctl services" #13806
Conversation
…ng the same --user/--global switches as "snap services"
0586d29
to
056d30c
Compare
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.
thanks
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.
Looks good thanks, very minor comments
if isGlobal { | ||
return servicestate.NewStatusDecorator(progress.Null) | ||
} else { | ||
return servicestate.NewStatusDecoratorForUid(progress.Null, ctx, uid) |
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.
This route is not covered in testing.
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.
This function is mocked intentionally - if we use NewStatusDecoratorForUid
then it will start to contact the snapd user client session which is unfortunate to start spinning up in all tests that use this. Instead the mock verifies that newStatusDecorator
is invoked with the expected arguments, and fakes the responses from from the status decorator.
The NewStatusDecoratorForUid
functionality, along with the user-session agent is tested independently.
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 assuming comments from @ernestl are addressed
Introduce matching functionality for "snapctl services" as in "snap services" by this PR #13381.
"Snapctl services" is one of the few commands that can run without being root user, which means we cannot make any assumptions around the user running the command, introducing the same decision logic around how to deal with the caller.