mirror of
https://github.com/containers/podman.git
synced 2025-06-27 21:50:18 +08:00
fix e2e test failure
it is possible for layers.names to be nil and we must account for that. Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
@ -841,15 +841,17 @@ func (i *Image) History(ctx context.Context) ([]*History, error) {
|
|||||||
delete(topLayerMap, layer.ID)
|
delete(topLayerMap, layer.ID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
h := History{
|
||||||
allHistory = append(allHistory, &History{
|
|
||||||
ID: id,
|
ID: id,
|
||||||
Created: oci.History[x].Created,
|
Created: oci.History[x].Created,
|
||||||
CreatedBy: oci.History[x].CreatedBy,
|
CreatedBy: oci.History[x].CreatedBy,
|
||||||
Size: size,
|
Size: size,
|
||||||
Comment: oci.History[x].Comment,
|
Comment: oci.History[x].Comment,
|
||||||
Tags: layer.Names,
|
}
|
||||||
})
|
if layer != nil {
|
||||||
|
h.Tags = layer.Names
|
||||||
|
}
|
||||||
|
allHistory = append(allHistory, &h)
|
||||||
|
|
||||||
if layer != nil && layer.Parent != "" && !oci.History[x].EmptyLayer {
|
if layer != nil && layer.Parent != "" && !oci.History[x].EmptyLayer {
|
||||||
layer, err = i.imageruntime.store.Layer(layer.Parent)
|
layer, err = i.imageruntime.store.Layer(layer.Parent)
|
||||||
|
@ -19,12 +19,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func BuildImage(w http.ResponseWriter, r *http.Request) {
|
func BuildImage(w http.ResponseWriter, r *http.Request) {
|
||||||
// contentType := r.Header.Get("Content-Type")
|
|
||||||
// if contentType != "application/x-tar" {
|
|
||||||
// Error(w, http.StatusText(http.StatusBadRequest), http.StatusBadRequest, errors.New("/build expects Content-Type of 'application/x-tar'"))
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
|
|
||||||
authConfigs := map[string]AuthConfig{}
|
authConfigs := map[string]AuthConfig{}
|
||||||
if hasHeader(r, "X-Registry-Config") {
|
if hasHeader(r, "X-Registry-Config") {
|
||||||
registryHeader := getHeader(r, "X-Registry-Config")
|
registryHeader := getHeader(r, "X-Registry-Config")
|
||||||
|
Reference in New Issue
Block a user