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

Fix distrobox-enter and distrobox-rm to handle containers that have environment variables shoter than 5 symbols #1545

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

senioroman4uk
Copy link
Contributor

When I was trying to use distrobox with rocm/pytorch:latest I've noticed the following error

Error: template: inspect:3:27: executing "inspect" at <slice . 0 5>: error calling slice: index out of range: 5

It turns out this image has an environmental variable CI=1, that causes an exception when distrobox-enter / distrobox-rm is used with this docker image

Added some additional ifs to the corresponding commands to handle this case

@senioroman4uk
Copy link
Contributor Author

Fixes #1546

Copy link

@softmoth softmoth left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Copy link

@softmoth softmoth left a comment

Choose a reason for hiding this comment

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

Actually, it's probably better to use the startswith function.

@89luca89
Copy link
Owner

Thanks @senioroman4uk for the PR and thanks @mirkobrombin for reviewing!

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