Add containerd support (#1793)

* [wip] add containerd UI handlers

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* Add containerd support

- Add UI handlers (done by @wagoodman)
- Add containerd types and wrappers (done by @wagoodman)
- Add flag for specifying containerd address

Closes #201

Signed-off-by: Shane Dell <shanedell100@gmail.com>

* Fix lint

Signed-off-by: Shane Dell <shanedell100@gmail.com>

* add containerd ui handler

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* add containerd scheme to readme

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* add test for scheme detection

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

---------

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Shane Dell <shanedell100@gmail.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Shane Dell
2023-09-18 11:33:43 -04:00
committed by GitHub
co-authored by Alex Goodman Alex Goodman
parent 594ba5f295
commit 23e3de75e3
7 changed files with 317 additions and 14 deletions
+2
View File
@@ -199,6 +199,8 @@ func parseDefaultImageSource(defaultImageSource string) image.Source {
return image.DockerDaemonSource
case "podman":
return image.PodmanDaemonSource
case "containerd":
return image.ContainerdDaemonSource
default:
return image.UnknownSource
}
+20
View File
@@ -247,6 +247,26 @@ func Test_Detect(t *testing.T) {
expectedScheme: unknownType,
expectedLocation: "",
},
{
name: "podman-image",
userInput: "containerd:anchore/syft",
detection: detectorResult{
src: image.PodmanDaemonSource,
ref: "anchore/syft",
},
expectedScheme: containerImageType,
expectedLocation: "anchore/syft",
},
{
name: "containerd-image",
userInput: "containerd:anchore/syft",
detection: detectorResult{
src: image.ContainerdDaemonSource,
ref: "anchore/syft",
},
expectedScheme: containerImageType,
expectedLocation: "anchore/syft",
},
}
for _, test := range testCases {
t.Run(test.name, func(t *testing.T) {