summaryrefslogtreecommitdiff
path: root/pkg/domain/infra/abi
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/domain/infra/abi')
-rw-r--r--pkg/domain/infra/abi/images.go6
-rw-r--r--pkg/domain/infra/abi/manifest.go12
-rw-r--r--pkg/domain/infra/abi/volumes.go9
3 files changed, 24 insertions, 3 deletions
diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go
index 1288ab09b..8ca93e770 100644
--- a/pkg/domain/infra/abi/images.go
+++ b/pkg/domain/infra/abi/images.go
@@ -241,9 +241,9 @@ func pull(ctx context.Context, runtime *image.Runtime, rawImage string, options
dockerRegistryOptions := image.DockerRegistryOptions{
DockerRegistryCreds: registryCreds,
DockerCertPath: options.CertDir,
- OSChoice: options.OverrideOS,
- ArchitectureChoice: options.OverrideArch,
- VariantChoice: options.OverrideVariant,
+ OSChoice: options.OS,
+ ArchitectureChoice: options.Arch,
+ VariantChoice: options.Variant,
DockerInsecureSkipTLSVerify: options.SkipTLSVerify,
}
diff --git a/pkg/domain/infra/abi/manifest.go b/pkg/domain/infra/abi/manifest.go
index 139032ad6..626f1f7bf 100644
--- a/pkg/domain/infra/abi/manifest.go
+++ b/pkg/domain/infra/abi/manifest.go
@@ -40,6 +40,18 @@ func (ir *ImageEngine) ManifestCreate(ctx context.Context, names, images []strin
return imageID, err
}
+// ManifestExists checks if a manifest list with the given name exists in local storage
+func (ir *ImageEngine) ManifestExists(ctx context.Context, name string) (*entities.BoolReport, error) {
+ if image, err := ir.Libpod.ImageRuntime().NewFromLocal(name); err == nil {
+ exists, err := image.ExistsManifest()
+ if err != nil && errors.Cause(err) != buildahManifests.ErrManifestTypeNotSupported {
+ return nil, err
+ }
+ return &entities.BoolReport{Value: exists}, nil
+ }
+ return &entities.BoolReport{Value: false}, nil
+}
+
// ManifestInspect returns the content of a manifest list or image
func (ir *ImageEngine) ManifestInspect(ctx context.Context, name string) ([]byte, error) {
if newImage, err := ir.Libpod.ImageRuntime().NewFromLocal(name); err == nil {
diff --git a/pkg/domain/infra/abi/volumes.go b/pkg/domain/infra/abi/volumes.go
index 823605052..f15aa2d14 100644
--- a/pkg/domain/infra/abi/volumes.go
+++ b/pkg/domain/infra/abi/volumes.go
@@ -153,3 +153,12 @@ func (ic *ContainerEngine) VolumeList(ctx context.Context, opts entities.VolumeL
}
return reports, nil
}
+
+// VolumeExists check if a given volume name exists
+func (ic *ContainerEngine) VolumeExists(ctx context.Context, nameOrID string) (*entities.BoolReport, error) {
+ exists, err := ic.Libpod.HasVolume(nameOrID)
+ if err != nil {
+ return nil, err
+ }
+ return &entities.BoolReport{Value: exists}, nil
+}