summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-05-24 12:50:59 -0400
committerGitHub <noreply@github.com>2022-05-24 12:50:59 -0400
commit2dc4f752c67e8e8c1035d6e2d689779cdc00004b (patch)
tree69557b4f1002fb85a3cb3c32401adeb7a4484c5b /pkg
parent7391bdfbbc418adbc85f6643cb67cdbd87fd0b7b (diff)
parent2400d1d52ff4199778781446445eef39a6e2c6b9 (diff)
downloadpodman-2dc4f752c67e8e8c1035d6e2d689779cdc00004b.tar.gz
podman-2dc4f752c67e8e8c1035d6e2d689779cdc00004b.tar.bz2
podman-2dc4f752c67e8e8c1035d6e2d689779cdc00004b.zip
Merge pull request #14341 from vrothberg/todo-part-1
TODO's and FIXME's [PART 1]
Diffstat (limited to 'pkg')
-rw-r--r--pkg/bindings/images/images.go2
-rw-r--r--pkg/bindings/images/pull.go1
-rw-r--r--pkg/bindings/images/rm.go3
-rw-r--r--pkg/domain/entities/images.go8
-rw-r--r--pkg/domain/infra/abi/images.go4
-rw-r--r--pkg/domain/infra/abi/images_list.go4
-rw-r--r--pkg/domain/infra/abi/images_test.go36
-rw-r--r--pkg/inspect/inspect.go15
8 files changed, 4 insertions, 69 deletions
diff --git a/pkg/bindings/images/images.go b/pkg/bindings/images/images.go
index 8e3b07929..32372019b 100644
--- a/pkg/bindings/images/images.go
+++ b/pkg/bindings/images/images.go
@@ -280,7 +280,6 @@ func Push(ctx context.Context, source string, destination string, options *PushO
if err != nil {
return err
}
- // TODO: have a global system context we can pass around (1st argument)
header, err := auth.MakeXRegistryAuthHeader(&imageTypes.SystemContext{AuthFilePath: options.GetAuthfile()}, options.GetUsername(), options.GetPassword())
if err != nil {
return err
@@ -329,7 +328,6 @@ func Search(ctx context.Context, term string, options *SearchOptions) ([]entitie
params.Set("tlsVerify", strconv.FormatBool(!options.GetSkipTLSVerify()))
}
- // TODO: have a global system context we can pass around (1st argument)
header, err := auth.MakeXRegistryAuthHeader(&imageTypes.SystemContext{AuthFilePath: options.GetAuthfile()}, "", "")
if err != nil {
return nil, err
diff --git a/pkg/bindings/images/pull.go b/pkg/bindings/images/pull.go
index 20e47179c..de02c62fd 100644
--- a/pkg/bindings/images/pull.go
+++ b/pkg/bindings/images/pull.go
@@ -42,7 +42,6 @@ func Pull(ctx context.Context, rawImage string, options *PullOptions) ([]string,
params.Set("tlsVerify", strconv.FormatBool(!options.GetSkipTLSVerify()))
}
- // TODO: have a global system context we can pass around (1st argument)
header, err := auth.MakeXRegistryAuthHeader(&types.SystemContext{AuthFilePath: options.GetAuthfile()}, options.GetUsername(), options.GetPassword())
if err != nil {
return nil, err
diff --git a/pkg/bindings/images/rm.go b/pkg/bindings/images/rm.go
index b80bacf45..eb3eef10c 100644
--- a/pkg/bindings/images/rm.go
+++ b/pkg/bindings/images/rm.go
@@ -16,9 +16,6 @@ func Remove(ctx context.Context, images []string, options *RemoveOptions) (*enti
if options == nil {
options = new(RemoveOptions)
}
- // FIXME - bindings tests are missing for this endpoint. Once the CI is
- // re-enabled for bindings, we need to add them. At the time of writing,
- // the tests don't compile.
var report types.LibpodImagesRemoveReport
conn, err := bindings.GetClient(ctx)
if err != nil {
diff --git a/pkg/domain/entities/images.go b/pkg/domain/entities/images.go
index 7081c5d25..2bb4ceb5b 100644
--- a/pkg/domain/entities/images.go
+++ b/pkg/domain/entities/images.go
@@ -66,10 +66,9 @@ type ImageSummary struct {
Dangling bool `json:",omitempty"`
// Podman extensions
- Names []string `json:",omitempty"`
- Digest string `json:",omitempty"`
- ConfigDigest string `json:",omitempty"`
- History []string `json:",omitempty"`
+ Names []string `json:",omitempty"`
+ Digest string `json:",omitempty"`
+ History []string `json:",omitempty"`
}
func (i *ImageSummary) Id() string { // nolint
@@ -398,7 +397,6 @@ type ImageUnmountOptions struct {
// ImageMountReport describes the response from image mount
type ImageMountReport struct {
- Err error
Id string // nolint
Name string
Repositories []string
diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go
index c3ec7dd8a..d469fa0ca 100644
--- a/pkg/domain/infra/abi/images.go
+++ b/pkg/domain/infra/abi/images.go
@@ -159,10 +159,6 @@ func (ir *ImageEngine) Mount(ctx context.Context, nameOrIDs []string, opts entit
mountReports := []*entities.ImageMountReport{}
listMountsOnly := !opts.All && len(nameOrIDs) == 0
for _, i := range images {
- // TODO: the .Err fields are not used. This pre-dates the
- // libimage migration but should be addressed at some point.
- // A quick glimpse at cmd/podman/image/mount.go suggests that
- // the errors needed to be handled there as well.
var mountPoint string
var err error
if listMountsOnly {
diff --git a/pkg/domain/infra/abi/images_list.go b/pkg/domain/infra/abi/images_list.go
index 9a0aaaf3a..8f5591e92 100644
--- a/pkg/domain/infra/abi/images_list.go
+++ b/pkg/domain/infra/abi/images_list.go
@@ -36,9 +36,7 @@ func (ir *ImageEngine) List(ctx context.Context, opts entities.ImageListOptions)
}
e := entities.ImageSummary{
- ID: img.ID(),
- // TODO: libpod/image didn't set it but libimage should
- // ConfigDigest: string(img.ConfigDigest),
+ ID: img.ID(),
Created: img.Created().Unix(),
Dangling: isDangling,
Digest: string(img.Digest()),
diff --git a/pkg/domain/infra/abi/images_test.go b/pkg/domain/infra/abi/images_test.go
index 311ab3ed7..3999de457 100644
--- a/pkg/domain/infra/abi/images_test.go
+++ b/pkg/domain/infra/abi/images_test.go
@@ -16,39 +16,3 @@ func TestToDomainHistoryLayer(t *testing.T) {
newLayer := toDomainHistoryLayer(&layer)
assert.Equal(t, layer.Size, newLayer.Size)
}
-
-//
-// import (
-// "context"
-// "testing"
-//
-// "github.com/stretchr/testify/mock"
-// )
-//
-// type MockImageRuntime struct {
-// mock.Mock
-// }
-//
-// func (m *MockImageRuntime) Delete(ctx context.Context, renderer func() interface{}, name string) error {
-// _ = m.Called(ctx, renderer, name)
-// return nil
-// }
-//
-// func TestImageSuccess(t *testing.T) {
-// actual := func() interface{} { return nil }
-//
-// m := new(MockImageRuntime)
-// m.On(
-// "Delete",
-// mock.AnythingOfType("*context.emptyCtx"),
-// mock.AnythingOfType("func() interface {}"),
-// "fedora").
-// Return(nil)
-//
-// r := DirectImageRuntime{m}
-// err := r.Delete(context.TODO(), actual, "fedora")
-// if err != nil {
-// t.Errorf("should be nil, got: %v", err)
-// }
-// m.AssertExpectations(t)
-// }
diff --git a/pkg/inspect/inspect.go b/pkg/inspect/inspect.go
index 767d86daf..15943858f 100644
--- a/pkg/inspect/inspect.go
+++ b/pkg/inspect/inspect.go
@@ -41,18 +41,3 @@ type RootFS struct {
Type string `json:"Type"`
Layers []digest.Digest `json:"Layers"`
}
-
-// ImageResult is used for podman images for collection and output.
-type ImageResult struct {
- Tag string
- Repository string
- RepoDigests []string
- RepoTags []string
- ID string
- Digest digest.Digest
- ConfigDigest digest.Digest
- Created time.Time
- Size *uint64
- Labels map[string]string
- Dangling bool
-}