Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
f2d41b85
Commit
f2d41b85
authored
Nov 15, 2021
by
Brian Williams
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix docker image parsing when image address contains a port
parent
8509751e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
3 deletions
+8
-3
ee/lib/gitlab/ci/reports/security/locations/container_scanning.rb
...itlab/ci/reports/security/locations/container_scanning.rb
+1
-1
ee/spec/lib/gitlab/ci/reports/security/locations/container_scanning_spec.rb
.../ci/reports/security/locations/container_scanning_spec.rb
+7
-2
No files found.
ee/lib/gitlab/ci/reports/security/locations/container_scanning.rb
View file @
f2d41b85
...
...
@@ -31,7 +31,7 @@ module Gitlab
def
docker_image_name_without_tag
image_name
=
default_branch_image
.
presence
||
image
base_name
,
version
=
image_name
.
split
(
':'
)
base_name
,
_
,
version
=
image_name
.
rpartition
(
':'
)
return
image
if
version_semver_like?
(
version
)
...
...
ee/spec/lib/gitlab/ci/reports/security/locations/container_scanning_spec.rb
View file @
f2d41b85
...
...
@@ -18,11 +18,11 @@ RSpec.describe Gitlab::Ci::Reports::Security::Locations::ContainerScanning do
it_behaves_like
'vulnerability location'
subject
{
described_class
.
new
(
**
params
)
}
describe
'fingerprint'
do
sha1_of
=
->
(
input
)
{
Digest
::
SHA1
.
hexdigest
(
input
)
}
subject
{
described_class
.
new
(
**
params
)
}
context
'with feature enabled'
do
before
do
stub_feature_flags
(
improved_container_scan_matching:
true
)
...
...
@@ -34,6 +34,11 @@ RSpec.describe Gitlab::Ci::Reports::Security::Locations::ContainerScanning do
[
'alpine:3.7'
,
nil
,
'alpine:3.7:glibc'
],
[
'alpine:8101518288111119448185914762536722131810'
,
nil
,
'alpine:glibc'
],
[
'alpine:1.0.0-beta'
,
nil
,
'alpine:1.0.0-beta:glibc'
],
[
'gdk.local:5000/group/project/branch:307e0a35643f63652a713d0820db7c388012f724'
,
nil
,
'gdk.local:5000/group/project/branch:glibc'
],
[
'registry.gitlab.com/group/project/tmp:af864bd61230d3d694eb01d6205b268b4ad63ac0'
,
nil
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment