Files
moby/daemon/images/image_changes.go
Derek McGowan f74e5d48b3 Create github.com/moby/moby/v2 module
Signed-off-by: Derek McGowan <derek@mcg.dev>
2025-07-31 10:13:29 -07:00

26 lines
665 B
Go

package images
import (
"context"
"errors"
"fmt"
"github.com/moby/go-archive"
"github.com/moby/moby/v2/daemon/container"
"github.com/moby/moby/v2/daemon/internal/layer"
)
func (i *ImageService) Changes(ctx context.Context, container *container.Container) ([]archive.Change, error) {
container.Lock()
defer container.Unlock()
if container.RWLayer == nil {
return nil, errors.New("RWLayer of container " + container.Name + " is unexpectedly nil")
}
rwLayer, ok := container.RWLayer.(layer.RWLayer)
if !ok {
return nil, fmt.Errorf("container %s has an unexpected RWLayer type: %T", container.Name, container.RWLayer)
}
return rwLayer.Changes()
}