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

Force env extension to the end, before user #130

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@

kwargs = {
'name': 'rocker',
'version': '0.2.3',
'version': '0.2.4',
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same comments here about changing the version and the unrelated changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I don't get it, the other version change was for the minor number but here I changed the patch version. Do you mean that I should let the version to 0.2.3?

'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',
],
],
'rocker.extensions': [
'devices = rocker.extensions:Devices',
'dev_helpers = rocker.extensions:DevHelpers',
Expand All @@ -54,7 +54,7 @@
'user = rocker.extensions:User',
'x11 = rocker.nvidia_extension:X11',
]
},
},
'author': 'Tully Foote',
'author_email': 'tfoote@osrfoundation.org',
'keywords': ['Docker'],
Expand Down
2 changes: 0 additions & 2 deletions src/rocker/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ def main():
print('DEPRECATION Warning: --noexecute is deprecated for --mode dry-run please switch your usage by December 2020')

active_extensions = extension_manager.get_active_extensions(args_dict)
# Force user to end if present otherwise it will break other extensions
active_extensions.sort(key=lambda e:e.get_name().startswith('user'))
print("Active extensions %s" % [e.get_name() for e in active_extensions])

base_image = args.image
Expand Down
6 changes: 6 additions & 0 deletions src/rocker/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@ def extend_cli_parser(self, parser, default_args={}):

def get_active_extensions(self, cli_args):
active_extensions = [e() for e in self.available_plugins.values() if e.check_args_for_activation(cli_args) and e.get_name() not in cli_args['extension_blacklist']]
# Force the 'env' extension temporary to the end so that user-set
# environment variables override environment variables possibly set by
# extensions.
active_extensions.sort(key=lambda e:e.get_name() == 'env')
# Force the 'user' extension to the end otherwise it will break other
# extensions.
active_extensions.sort(key=lambda e:e.get_name().startswith('user'))
return active_extensions

Expand Down