Skip to content

Commit

Permalink
Pass all local images for container integration details
Browse files Browse the repository at this point in the history
On some systems a toolbox container has an intermediate image as image
which since 17d2588 is no longer passed
to the renderRow.

Closes #1649
  • Loading branch information
jelly committed Apr 5, 2024
1 parent cc0c818 commit c28cab1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
23 changes: 11 additions & 12 deletions src/Containers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -677,28 +677,27 @@ class Containers extends React.Component {

// Convert to the search result output
let localImages = null;
let nonIntermediateImages = null;
if (this.props.images) {
localImages = Object.keys(this.props.images).reduce((images, id) => {
localImages = Object.keys(this.props.images).map(id => {
const img = this.props.images[id];
if (img.RepoTags) {
img.Index = img.RepoTags[0].split('/')[0];
img.Name = img.RepoTags[0];
img.toString = function imgToString() { return this.Name };
images.push(img);
}
return images;
img.Index = img.RepoTags ? img.RepoTags[0].split('/')[0] : "";
img.Name = utils.image_name(img);
img.toString = function imgToString() { return this.Name };
return img;
}, []);
nonIntermediateImages = localImages.filter(img => img.Index !== "");
}

const createContainer = (inPod) => {
if (localImages)
if (nonIntermediateImages)
Dialogs.show(
<utils.PodmanInfoContext.Consumer>
{(podmanInfo) => (
<DialogsContext.Consumer>
{(Dialogs) => (
<ImageRunModal user={this.props.user}
localImages={localImages}
localImages={nonIntermediateImages}
pod={inPod}
systemServiceAvailable={this.props.systemServiceAvailable}
userServiceAvailable={this.props.userServiceAvailable}
Expand Down Expand Up @@ -742,7 +741,7 @@ class Containers extends React.Component {
<ToolbarItem>
<Button variant="primary" key="get-new-image-action"
id="containers-containers-create-container-btn"
isDisabled={localImages === null}
isDisabled={nonIntermediateImages === null}
onClick={() => createContainer(null)}>
{_("Create container")}
</Button>
Expand Down Expand Up @@ -825,7 +824,7 @@ class Containers extends React.Component {
<Badge isRead className={"ct-badge-pod-" + podStatus.toLowerCase()}>{_(podStatus)}</Badge>
<Button variant="secondary"
className="create-container-in-pod"
isDisabled={localImages === null}
isDisabled={nonIntermediateImages === null}
onClick={() => createContainer(this.props.pods[section])}>
{_("Create container in pod")}
</Button>
Expand Down
2 changes: 2 additions & 0 deletions test/check-application
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,8 @@ class TestApplication(testlib.MachineCase):
b.wait_not_present("div.pf-v5-c-modal-box")
self.waitContainerRow(IMG_INTERMEDIATE)

# Integration tab should crash with an intermediate image

# Delete intermediate image which is in use
self.execute(auth, f"podman untag {IMG_INTERMEDIATE}")
clickDeleteImage(intermediate_image_sel)
Expand Down

0 comments on commit c28cab1

Please sign in to comment.