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

[Bug]: Docker image without a digest or tag crashes the imageList.widget #246

Closed
saemik94 opened this issue Jul 18, 2023 · 2 comments
Closed
Assignees
Labels

Comments

@saemik94
Copy link
Contributor

What went wrong?

Hi there
Great job you did here, I really like your tool and I already recommended dockly to serveral friends :)

I stumbled over an issue after creating some local docker images. The local built images don't have a digest or tag and this leads to a bug in the imageList.widget and then the application crashes:
local-images
Empty digest:
error1

It's on immageList.widget line 52, at this point image.RepoDigests is of type object and it's value is an empty array. So the if statement evaluates to true and the split on image.RepoDigests[0] fails and leads to the crash.

Empty tag:
error2

It's on immageList.widget line 48, at this point the if statement, to check the tag value evaluates to true. Therefore the split leads then to the crash.

Proposed solution:
immageList.widget line 52
image.RepoDigests?.length ? image.RepoDigests[0].split('@')[0] : getTag(image[2], 0),

immageList.widget line 48
const getTag = (tag, part) => tag?.length ? tag[0].split(':')[part] : 'none'

With those two changes dockly runs as smooth as always, when I build it locally. If you would like, I can also create a pull request. Either way I hope I could help a little.

Your environment setup

  • Operating System: Ubuntu 22.04.2 LTS
  • Node.js version: v19.3.0
  • Package version: dockly 3.23.0
  • Docker version: Docker version 24.0.4
@lirantal
Copy link
Owner

@saemik94 thank you for the kind words ❤️
would indeed be great if you wanted to send over a pull request and we'll happily merge and publish a new release.

@saemik94
Copy link
Contributor Author

The fix was successfully tested in version 3.23.1, the issue is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants