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 error on Layer section and reduce information on one line per step. #395

Merged
merged 1 commit into from
Jul 6, 2023
Merged

Fix error on Layer section and reduce information on one line per step. #395

merged 1 commit into from
Jul 6, 2023

Conversation

lightsnowball
Copy link

@lightsnowball lightsnowball commented Apr 22, 2022

When scrolling through commands in Layers section, in the case of multiline commands, the user could cause an index out of bounds error by scrolling to much. Here is an example:

dive_wrong

and Dockerfile used is as follows:

# syntax=docker/dockerfile:1.3-labs                                                                 
FROM archlinux                                                                                      
                                                                                                    
RUN <<-EOF                                                                                          
    echo "Look what they've done to my line, it's ruined! Ruined, I tell ya! Because maybe I have a wide monitor that can fit more than 50 chars so I shall not be hindered by mere mortals! 
    cd /tmp                                                                                         
    cd /                                                                                            
EOF                                                                                                 
                                                                                                    
WORKDIR /home/bajo 

It's hard to see, but when the user just presses down, at one point it panics from dive.exe.
Therefore multiline is now limited to just one line, as it also seems redundant to have the same information in Layers and Layers Details sections.

Instead of printing out multiple lines for some steps in Layer section,
now its only printing one line while other informations can be found in
Layer details. This change also provides fix for index out of bounds
error when user scrolls through steps in Layer section and there exists
at least one step with multi-line commands.
@patcon
Copy link

patcon commented Jun 10, 2022

Potentially related: #328 (comment)

I'm seeing this with my use of HEREDOC multi-line commands. Seems that the dive layer list doesn't size correctly, and scrolls "off-screen", and then crashes when scrolling too far.

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.

Dive is crashing when browsing layers of paketobuildpacks/run:base-cnb image
3 participants