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 3, 2024
1 parent cc0c818 commit ed95e32
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/Containers.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -677,28 +677,33 @@ 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);
} else {
img.Index = "";
img.Name = "<none:none>";
img.toString = function imgToString() { return this.Name };
}
return images;
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 +747,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 +830,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

0 comments on commit ed95e32

Please sign in to comment.