Skip to content

imageserver: add directory dashboard and ability to list images in a directory#256

Open
narendraReddy45 wants to merge 4 commits intoCloud-Foundations:masterfrom
narendraReddy45:issue_248_imageserver_dashboard_dir_link_to_images
Open

imageserver: add directory dashboard and ability to list images in a directory#256
narendraReddy45 wants to merge 4 commits intoCloud-Foundations:masterfrom
narendraReddy45:issue_248_imageserver_dashboard_dir_link_to_images

Conversation

@narendraReddy45
Copy link
Copy Markdown
Contributor

@narendraReddy45 narendraReddy45 commented May 3, 2026

Description & Motivation

This PR implements the below:

  • Adds directory dashboard and the ability to list images in a directory in the listDirectories api
  • listImages api now accepts query parameter directoryName and returns images matching that directoryName prefix

Approach

The image database currently has a hashmap of image names and their respective metadata. To get all images matching a certain prefix, we could do a linear search on each element and return a list of images.

But this approach may not be scalable, as listImages would loop over len(images) for every call, sort the results, and return.

Optimized the prefix search by creating an index on image names. The index is implemented using a golang slice, maintaining a sorted order of elements and doing a binary search every time a search is needed.

As our dataset grows, we can eventually shift to a trie-based index for better performance. As trie improves insertion and deletion to O(L) where L is the length of the imagename.

Given our dataset N ( e.g.636: from http://imageserver.dev.purestorage.com:6971/metrics/image-count ) is smaller , the performance is comparable and slices are contiguous

Fixes #248

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Documentation update

How Has This Been Tested?

  • deployed local imageserver, created directories and added images and verified the dashboard

Testing Approach

image image image

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

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.

Imageserver: add directory dashboard and ability to list images in a directory.

1 participant