mirror of
https://github.com/anchore/syft.git
synced 2026-10-31 14:36:33 +01:00
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:
co-authored by
Alex Goodman
Alex Goodman
parent
594ba5f295
commit
23e3de75e3
@@ -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
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user