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

Interactive Execute on Container #348

Merged
merged 8 commits into from
Jan 18, 2019

Conversation

felix-engelmann
Copy link
Contributor

It might be interesting to get the websockets to interact with a container, e.g. on a shell.
Therefore interactive_execute on a container returns a data and control websocket. By design of lxd, they include a secret, so no additional authentication is required to connect to them. They are then perfect to be passed to a web terminal.

Signed-off-by: Felix Engelmann <fe-github@nlogn.org>
Signed-off-by: Felix Engelmann <fe-github@nlogn.org>
Signed-off-by: Felix Engelmann <fe-github@nlogn.org>
Signed-off-by: Felix Engelmann <fe-github@nlogn.org>
@codecov-io
Copy link

codecov-io commented Dec 15, 2018

Codecov Report

Merging #348 into master will increase coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #348      +/-   ##
==========================================
+ Coverage   96.83%   96.89%   +0.05%     
==========================================
  Files          12       12              
  Lines         980      997      +17     
  Branches      110      111       +1     
==========================================
+ Hits          949      966      +17     
  Misses         12       12              
  Partials       19       19
Impacted Files Coverage Δ
pylxd/models/container.py 91.82% <100%> (+0.36%) ⬆️
pylxd/client.py 98.71% <0%> (+0.02%) ⬆️
pylxd/models/operation.py 96.77% <0%> (+0.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad07da9...6458c08. Read the comment docs.

Signed-off-by: Felix Engelmann <fe-github@nlogn.org>
Signed-off-by: Felix Engelmann <fe-github@nlogn.org>
@ajkavanagh
Copy link
Contributor

I think that this is an interesting addition, although it ought to come with a "health warning" as the caller has to do quite a bit of work to complete the command. I think that perhaps the function should be renamed slightly (to raw_...) to indicate that it's low lever, and it might be useful (if possible!) to provide an example in the documentation part of the repo about how it might get used. I'm going to add some comments to the review, but as I said, this is an interesting addition. Let's work it through to get it landed. Thanks!

Copy link
Contributor

@ajkavanagh ajkavanagh left a comment

Choose a reason for hiding this comment

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

This is good; just a few minor formatting and comment changes.

doc/source/containers.rst Outdated Show resolved Hide resolved
pylxd/models/container.py Outdated Show resolved Hide resolved
pylxd/models/container.py Show resolved Hide resolved
@Miso-K
Copy link

Miso-K commented Jan 17, 2019

Hi, this is the great addition. Now I am using just customized execute() function to get data for using web terminal in .js.

Signed-off-by: Felix Engelmann <fe-github@nlogn.org>
Signed-off-by: Felix Engelmann <fe-github@nlogn.org>
@ajkavanagh
Copy link
Contributor

Thanks very much for the changes; I now understand the use case! Essentially, you provide these back to a web browser app and that does the handling of the websockets. Very interesting. Thanks for the addition.

@ajkavanagh ajkavanagh merged commit d5d47a4 into canonical:master Jan 18, 2019
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.

4 participants