Skip to content

Commit

Permalink
Fix searching containers with full URL
Browse files Browse the repository at this point in the history
Fixes bug that makes it impossible to search containers with full URL
such as `docker.io/{user}/{container_name}`.
  • Loading branch information
tomasmatus committed Jul 30, 2024
1 parent bdf2c96 commit fa211bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ImageRunModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ export class ImageRunModal extends React.Component {
}

// Strip out all non-allowed container image characters when filtering.
let regexString = searchText.replace(/[^\w_.:-]/g, "");
let regexString = searchText.replace(/[^\/\w_.:-]/g, "");
// Strip image registry option if set for comparing results for docker.io searching for docker.io/fedora
// returns docker.io/$username/fedora for example.
if (regexString.includes('/')) {
Expand Down
5 changes: 4 additions & 1 deletion test/check-application
Original file line number Diff line number Diff line change
Expand Up @@ -1767,7 +1767,10 @@ class TestApplication(testlib.MachineCase):
b.set_input_text("#run-image-dialog-name", container_name)

# Local registry
b.set_input_text("#create-image-image-select-typeahead", "my-busybox")
b.set_input_text("#create-image-image-select-typeahead", "no-container")
b.wait_text("button.pf-v5-c-select__menu-item.pf-m-disabled", "No images found")
# Search with full url
b.set_input_text("#create-image-image-select-typeahead", "localhost:5000/my-busybox")
b.click('button.pf-v5-c-toggle-group__button:contains("Local")')

# Select image
Expand Down

0 comments on commit fa211bb

Please sign in to comment.