Skip to content
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

feat: add postgresql classifier #1536

Merged
merged 2 commits into from
Feb 8, 2023

Conversation

witchcraze
Copy link
Contributor

This PR adds a binary cataloger for postgresql

  • make some test files by echo -en '\x00{version}'
  • update httpd package version for integration test

fixes #1456

Signed-off-by: witchcraze <witchcraze@gmail.com>
@witchcraze
Copy link
Contributor Author

local integration results

=== RUN   TestPackageDeduplication
=== RUN   TestPackageDeduplication/AllLayers
=== RUN   TestPackageDeduplication/Squashed
--- PASS: TestPackageDeduplication (22.60s)
    --- PASS: TestPackageDeduplication/AllLayers (16.65s)
    --- PASS: TestPackageDeduplication/Squashed (5.95s)

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
@wagoodman
Copy link
Contributor

wagoodman commented Feb 8, 2023

I'm seeing the tests fail locally in the same way that is failing in CI. I'm not certain why you are seeing anything different... what os/arch are you running this from? And have you tried purging the image cache ( rm test/integration/test-fixtures/cache/stereoscope-fixture-image-vertical-package-dups-*) and fixture image from docker (docker images | grep image-vertical-package-dups then docker rmi the entries) and re-running? We want to make the tests as stable as possible so I'm curious for how that goes.

In the meantime I reverted the integration test change.

@wagoodman wagoodman added the enhancement New feature or request label Feb 8, 2023
@wagoodman wagoodman merged commit 2848141 into anchore:main Feb 8, 2023
@witchcraze
Copy link
Contributor Author

@wagoodman

Thank you for your support.

what os/arch are you running this from?

Platform : WSL2
OS : Debian11
arch : x86_64
Go : 1.19

$ uname -a
Linux e14 5.15.79.1-microsoft-standard-WSL2 #1 SMP Wed Nov 23 01:01:46 UTC 2022 x86_64 GNU/Linux
$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
$ go version
go version go1.19 linux/amd64

have you tried purging the image cache ...

Now, I did below.
From message, 2.4.6-98.el7.centos.6 seemes installed.

$ rm test/integration/test-fixtures/cache/stereoscope-fixture-image-vertical-package-dups-*
$ docker image rm -f $(docker images -q)
$ make clean
$ make bootstrap
$ make unit
:
:
Coverage: 68.0%
$ make integration
:
:
================================================================================
 Package           Arch        Version                       Repository    Size
================================================================================
Installing:
 httpd             x86_64      2.4.6-98.el7.centos.6         updates      2.7 M
Installing for dependencies:
 apr               x86_64      1.4.8-7.el7                   base         104 k
 apr-util          x86_64      1.5.2-6.el7                   base          92 k
 centos-logos      noarch      70.0.6-3.el7.centos           base          21 M
 httpd-tools       x86_64      2.4.6-98.el7.centos.6         updates       94 k
 mailcap           noarch      2.1.41-2.el7                  base          31 k

Transaction Summary
================================================================================
:
ok      github.com/anchore/syft/test/integration        534.328s

In my environment, centos:7.9.2009 provides 2.4.6-98.el7.centos.6, not 2.4.6-97.el7.centos.5
From CentOS Mirror, 2.4.6-98.el7.centos.6 was from 2023-01-27 18:02.

$ docker run -it --rm centos:7.9.2009 yum --showduplicates list | grep '^httpd.x86_64'
httpd.x86_64                              2.4.6-95.el7.centos            base
httpd.x86_64                              2.4.6-97.el7.centos            updates
httpd.x86_64                              2.4.6-97.el7.centos.1          updates
httpd.x86_64                              2.4.6-97.el7.centos.2          updates
httpd.x86_64                              2.4.6-97.el7.centos.4          updates
httpd.x86_64                              2.4.6-97.el7.centos.5          updates
httpd.x86_64                              2.4.6-98.el7.centos.6          updates

We want to make the tests as stable as possible so I'm curious for how that goes.

I'll try to fix versions in
https://github.com/anchore/syft/blob/main/test/integration/test-fixtures/image-vertical-package-dups/Dockerfile

@witchcraze witchcraze deleted the postgresql-binary-classifier branch February 9, 2023 02:17
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
* add postgresql classifier
Signed-off-by: witchcraze <witchcraze@gmail.com>

* revert package dedup test upgrade

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

---------

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Catalog postgres binary
2 participants