-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add the privileged extension #132
Conversation
Signed-off-by: Gaël Écorchard <gael.ecorchard@cvut.cz>
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 this will be useful to add. I had a few requests to clean up the patch but otherwise it looks good.
setup.py
Outdated
@@ -31,30 +31,31 @@ | |||
|
|||
kwargs = { | |||
'name': 'rocker', | |||
'version': '0.2.3', | |||
'version': '0.3.0', |
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.
please don't change the version number in a patch. This will be done at release time.
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.
My point of view on this is that we add a functionality and thus must increment the minor version number but will obey to your request. I'll increment first RP #130.
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, that's the policy for semantic versioning. But this commit is not the release. There may be multiple additions that go into the next release. And I couldn't merge this PR at the same time as your other one because this change would conflict.
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.
I get it with the version number. I actually never contributed to a release-based repository. How do you then manage the version change? Do contributors have to notify somewhere that they did a change that provokes a version change?
setup.py
Outdated
'packages': ['rocker'], | ||
'package_dir': {'': 'src'}, | ||
'package_data': {'rocker': ['templates/*.em']}, | ||
'entry_points': { | ||
'console_scripts': [ | ||
'rocker = rocker.cli:main', | ||
'detect_docker_image_os = rocker.cli:detect_image_os', | ||
], | ||
], |
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.
please avoid unrelated changes to the PR.
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.
A little cleanup can be done, but it should be at least separated to a different commit.
src/rocker/extensions.py
Outdated
return '' | ||
|
||
def get_docker_args(self, cli_args): | ||
return '--privileged' |
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 needs to be prepended with whitespace to make sure not to run into a preceding argument if not first.
return '--privileged' | |
return ' --privileged' |
They are currently string appended
Line 257 in 4f9f6d7
docker_args += e.get_docker_args(self.cliargs) |
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.
Wouldn't it be better to actually let extensions return a list of strings and let core.py manage formatting the command, if needed?
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.
I think a single string at least with core.py inserting the space. "If needed" is not clearly resolved if I return multiple.
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 might be a few words missing in these last sentences and I don't get their sense. Anyway, with "if needed", I meant that subprocess.run
and partially pexcpect.spawn
accept a list of strings as argument to launch the command.
- Add a space before the argument in the case that the option is not first. - Increment patch version rather than minor (i.e. partially revert previous commit). - Revert unrelated changes compared to master. Signed-off-by: Gaël Écorchard <gael.ecorchard@cvut.cz>
Signed-off-by: Gaël Écorchard <gael.ecorchard@cvut.cz>
Reverted the version number and unrelated changes. Should I squeeze commits? |
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 for cleaning it up. I added some tests too. I'll just wait for CI to return. Don't worry about cleaning up the commit history, I'll squash when merging.
Coverage isn't reporting directly: 100% diff coverage now https://app.codecov.io/gh/osrf/rocker/compare/132/overview |
* Add the privileged extension Signed-off-by: Gaël Écorchard <gael.ecorchard@cvut.cz> Co-authored-by: Tully Foote <tfoote@osrfoundation.org>
Signed-off-by: Gaël Écorchard gael.ecorchard@cvut.cz