Skip to content

version of types upgraded to 1.0.8 (AST-0000) #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/Checkmarx/containers-images-extractor
go 1.24.1

require (
github.com/Checkmarx/containers-types v1.0.7
github.com/Checkmarx/containers-types v1.0.8
github.com/rs/zerolog v1.34.0
gopkg.in/yaml.v3 v3.0.1
helm.sh/helm/v3 v3.17.3
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEK
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/Checkmarx/containers-types v1.0.7 h1:SZUB8S//yFc1WlgLbw33conN5eR9CLv+DTewxMGVp7M=
github.com/Checkmarx/containers-types v1.0.7/go.mod h1:KR0w8XCosq3+6jRCfQrH7i//Nj2u11qaUJM62CREFZA=
github.com/Checkmarx/containers-types v1.0.8 h1:8zUhhqmODJSpcLFcFNk1OoHdw7bbj8PdQsBghbmLP08=
github.com/Checkmarx/containers-types v1.0.8/go.mod h1:KR0w8XCosq3+6jRCfQrH7i//Nj2u11qaUJM62CREFZA=
github.com/DATA-DOG/go-sqlmock v1.5.2 h1:OcvFkGmslmlZibjAjaHm3L//6LiuBgolP7OputlJIzU=
github.com/DATA-DOG/go-sqlmock v1.5.2/go.mod h1:88MAG/4G7SMwSE3CeA0ZKzrT5CiOU3OJ+JlNzwDqpNU=
github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ4pzQ=
Expand Down
20 changes: 10 additions & 10 deletions pkg/imagesExtractor/files_extractor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ func TestExtractAndMergeImagesFromFiles(t *testing.T) {
},
},
UserInput: []types.ImageModel{
{Name: "debian:11", ImageLocations: []types.ImageLocation{{Origin: types.UserInput, Path: types.NoFilePath}}},
{Name: "debian:11", ImageLocations: []types.ImageLocation{{Origin: types.UserInput, Path: types.CustomImages}}},
},
ExpectedImages: []types.ImageModel{
{Name: "debian:11", ImageLocations: []types.ImageLocation{{Origin: types.UserInput, Path: types.NoFilePath, Line: 0, StartIndex: 0, EndIndex: 0}}},
{Name: "debian:11", ImageLocations: []types.ImageLocation{{Origin: types.UserInput, Path: types.CustomImages, Line: 0, StartIndex: 0, EndIndex: 0}}},
{Name: "mcr.microsoft.com/dotnet/sdk:6.0", ImageLocations: []types.ImageLocation{{Origin: types.DockerFileOrigin, Path: "Dockerfile", FinalStage: false, Line: 1, StartIndex: 5, EndIndex: 37}}},
{Name: "mcr.microsoft.com/dotnet/aspnet:6.0", ImageLocations: []types.ImageLocation{{Origin: types.DockerFileOrigin, Path: "Dockerfile", FinalStage: true, Line: 25, StartIndex: 5, EndIndex: 40}}},
{Name: "buildimage:latest", ImageLocations: []types.ImageLocation{{Origin: types.DockerComposeFileOrigin, Path: "docker-compose1.yml", Line: 0, StartIndex: 0, EndIndex: 0}}},
Expand All @@ -61,11 +61,11 @@ func TestExtractAndMergeImagesFromFiles(t *testing.T) {
},
},
UserInput: []types.ImageModel{
{Name: "mcr.microsoft.com/dotnet/sdk:6.0", ImageLocations: []types.ImageLocation{{Origin: types.UserInput, Path: types.NoFilePath, Line: 1, StartIndex: 5, EndIndex: 37}}},
{Name: "mcr.microsoft.com/dotnet/sdk:6.0", ImageLocations: []types.ImageLocation{{Origin: types.UserInput, Path: types.CustomImages, Line: 1, StartIndex: 5, EndIndex: 37}}},
},
ExpectedImages: []types.ImageModel{
{Name: "mcr.microsoft.com/dotnet/sdk:6.0", ImageLocations: []types.ImageLocation{
{Origin: types.UserInput, Path: types.NoFilePath, Line: 1, StartIndex: 5, EndIndex: 37},
{Origin: types.UserInput, Path: types.CustomImages, Line: 1, StartIndex: 5, EndIndex: 37},
{Origin: types.DockerFileOrigin, Path: "Dockerfile", Line: 1, StartIndex: 5, EndIndex: 37},
{Origin: types.DockerComposeFileOrigin, Path: "docker-compose-4.yml", Line: 0, StartIndex: 0, EndIndex: 0},
}},
Expand All @@ -80,12 +80,12 @@ func TestExtractAndMergeImagesFromFiles(t *testing.T) {
},
},
UserInput: []types.ImageModel{
{Name: "debian:11", ImageLocations: []types.ImageLocation{{Origin: types.UserInput, Path: types.NoFilePath}}},
{Name: "debian:11", ImageLocations: []types.ImageLocation{{Origin: types.UserInput, Path: types.CustomImages}}},
},
ExpectedImages: []types.ImageModel{
{Name: "mcr.microsoft.com/dotnet/sdk:6.0", ImageLocations: []types.ImageLocation{{Origin: types.DockerFileOrigin, Path: "Dockerfile", FinalStage: false, Line: 1, StartIndex: 5, EndIndex: 37}}},
{Name: "mcr.microsoft.com/dotnet/aspnet:6.0", ImageLocations: []types.ImageLocation{{Origin: types.DockerFileOrigin, Path: "Dockerfile", FinalStage: true, Line: 25, StartIndex: 5, EndIndex: 40}}},
{Name: "debian:11", ImageLocations: []types.ImageLocation{{Origin: types.UserInput, Path: types.NoFilePath, Line: 0, StartIndex: 0, EndIndex: 0}}}},
{Name: "debian:11", ImageLocations: []types.ImageLocation{{Origin: types.UserInput, Path: types.CustomImages, Line: 0, StartIndex: 0, EndIndex: 0}}}},
},
{
Name: "OnlyDockerComposeFound",
Expand All @@ -95,11 +95,11 @@ func TestExtractAndMergeImagesFromFiles(t *testing.T) {
},
},
UserInput: []types.ImageModel{
{Name: "debian:11", ImageLocations: []types.ImageLocation{{Origin: types.UserInput, Path: types.NoFilePath}}},
{Name: "debian:11", ImageLocations: []types.ImageLocation{{Origin: types.UserInput, Path: types.CustomImages}}},
},
ExpectedImages: []types.ImageModel{
{Name: "mcr.microsoft.com/dotnet/sdk:6.0", ImageLocations: []types.ImageLocation{{Origin: types.DockerComposeFileOrigin, Path: "docker-compose-4.yml", Line: 0, StartIndex: 0, EndIndex: 0}}},
{Name: "debian:11", ImageLocations: []types.ImageLocation{{Origin: types.UserInput, Path: types.NoFilePath, Line: 0, StartIndex: 0, EndIndex: 0}}},
{Name: "debian:11", ImageLocations: []types.ImageLocation{{Origin: types.UserInput, Path: types.CustomImages, Line: 0, StartIndex: 0, EndIndex: 0}}},
},
},
{
Expand All @@ -115,10 +115,10 @@ func TestExtractAndMergeImagesFromFiles(t *testing.T) {
},
},
UserInput: []types.ImageModel{
{Name: "debian:11", ImageLocations: []types.ImageLocation{{Origin: types.UserInput, Path: types.NoFilePath}}},
{Name: "debian:11", ImageLocations: []types.ImageLocation{{Origin: types.UserInput, Path: types.CustomImages}}},
},
ExpectedImages: []types.ImageModel{
{Name: "debian:11", ImageLocations: []types.ImageLocation{{Origin: types.UserInput, Path: types.NoFilePath, Line: 0, StartIndex: 0, EndIndex: 0}}},
{Name: "debian:11", ImageLocations: []types.ImageLocation{{Origin: types.UserInput, Path: types.CustomImages, Line: 0, StartIndex: 0, EndIndex: 0}}},
{Name: "checkmarx.jfrog.io/ast-docker/containers-worker:b201b1f", ImageLocations: []types.ImageLocation{{Origin: types.HelmFileOrigin, Path: "containers/templates/containers-worker.yaml", Line: 0, StartIndex: 0, EndIndex: 0}}},
{Name: "checkmarx.jfrog.io/ast-docker/image-insights:f4b507b", ImageLocations: []types.ImageLocation{{Origin: types.HelmFileOrigin, Path: "containers/templates/image-insights.yaml", Line: 0, StartIndex: 0, EndIndex: 0}}},
},
Expand Down
Loading