mirror of https://github.com/portainer/portainer
fix(docker/image): swarm image list issue [EE-6374] (#10710)
parent
3cf36b0e93
commit
5c7f6aab66
|
@ -2,6 +2,7 @@ package images
|
|||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/portainer/portainer/api/http/handler/docker/utils"
|
||||
|
@ -66,6 +67,12 @@ func (handler *Handler) imagesList(w http.ResponseWriter, r *http.Request) *http
|
|||
|
||||
imagesList := make([]ImageResponse, len(images))
|
||||
for i, image := range images {
|
||||
if (image.RepoTags == nil || len(image.RepoTags) == 0) && (image.RepoDigests != nil && len(image.RepoDigests) > 0) {
|
||||
for _, repoDigest := range image.RepoDigests {
|
||||
image.RepoTags = append(image.RepoTags, repoDigest[0:strings.Index(repoDigest, "@")]+":<none>")
|
||||
}
|
||||
}
|
||||
|
||||
imagesList[i] = ImageResponse{
|
||||
Created: image.Created,
|
||||
ID: image.ID,
|
||||
|
|
|
@ -26,8 +26,8 @@ export function TableContent<T extends DefaultType = DefaultType>({
|
|||
|
||||
return (
|
||||
<>
|
||||
{rows.map((row) => (
|
||||
<Fragment key={row.id}>{renderRow(row)}</Fragment>
|
||||
{rows.map((row, index) => (
|
||||
<Fragment key={`${row.id}-${index}`}>{renderRow(row)}</Fragment>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue