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

photon support #129

Merged

Conversation

ppadmavilasom
Copy link
Contributor

Continuing the discussion from #118

@ldelossa please advice further steps required

@ppadmavilasom
Copy link
Contributor Author

ping.

@ldelossa
Copy link
Contributor

ldelossa commented Mar 6, 2020

Very cool. Ill pull down your code and confirm its working today. Sorry for the delay!

@ldelossa
Copy link
Contributor

ldelossa commented Mar 6, 2020

@ppadmavilasom

looks good so far. indexing seems correct. However we are running into a bug that's been fixed in latest release. Can you please rebase this branch onto of master.

@ppadmavilasom ppadmavilasom force-pushed the topic/ppadmavilasom/photon_support branch from 6a116c2 to cdbfcf3 Compare March 6, 2020 19:04
@ppadmavilasom
Copy link
Contributor Author

Thank you @ldelossa Rebased.

@ldelossa
Copy link
Contributor

ldelossa commented Mar 6, 2020

@ppadmavilasom cool, re-checking

@ppadmavilasom
Copy link
Contributor Author

fyi. this is what i have done to validate while developing (from the photon folder)
go test -v -count=1 -race -tags integration .
is there something else i can do to verify the change?

@ldelossa
Copy link
Contributor

ldelossa commented Mar 6, 2020

@ppadmavilasom it would be good to obtain an IndexReport from the api and give it a spot check. That is what I am doing just to confirm json schemas look good.

@ldelossa
Copy link
Contributor

ldelossa commented Mar 6, 2020

  "distributions": {
    "1": {
      "id": "1",
      "did": "photon",
      "name": "VMware Photon",
      "version": "1.0",
      "version_code_name": "",
      "version_id": "1.0",
      "arch": "",
      "cpe": "",
      "pretty_name": "VMware Photon/Linux"
    }
  },
  "repository": {},
  "environments": {
    "11": [
      {
        "package_db": "/var/lib/rpm",
        "introduced_in": "sha256:93ed40df0ce1909a7554bfaa7dd7d0fffa7e3465ead0f458b183b82ce52c3d3e",
        "distribution_id": "",
        "repository_id": ""
      }
    ],

something is a little funky. packages are not being linked with distributions.

Using your branch you can see that Ubuntu links correct

  "distributions": {
    "4": {
      "id": "4",
      "did": "ubuntu",
      "name": "Ubuntu",
      "version": "18.04.3 LTS (Bionic Beaver)",
      "version_code_name": "bionic",
      "version_id": "18.04",
      "arch": "",
      "cpe": "",
      "pretty_name": "Ubuntu 18.04.3 LTS"
    },
    "5": {
      "id": "5",
      "did": "ubuntu",
      "name": "Ubuntu",
      "version": "18.04.4 LTS (Bionic Beaver)",
      "version_code_name": "bionic",
      "version_id": "18.04",
      "arch": "",
      "cpe": "",
      "pretty_name": "Ubuntu 18.04.4 LTS"
    }
  },
  "repository": {},
  "environments": {
    "118": [
      {
        "package_db": "var/lib/dpkg/status",
        "introduced_in": "sha256:423ae2b273f4c17ceee9e8482fa8d071d90c7d052ae208e1fe4963fceb3d6954",
        "distribution_id": "4",
        "repository_id": ""
      }
    ],

@ldelossa
Copy link
Contributor

ldelossa commented Mar 6, 2020

@ppadmavilasom

Plz apply this patch:

diff --git a/rpm/ecosystem.go b/rpm/ecosystem.go
index 03b2957..8c62516 100644
--- a/rpm/ecosystem.go
+++ b/rpm/ecosystem.go
@@ -7,6 +7,7 @@ import (
        "github.com/quay/claircore/internal/indexer"
        "github.com/quay/claircore/internal/indexer/linux"
        "github.com/quay/claircore/oracle"
+       "github.com/quay/claircore/photon"
        "github.com/quay/claircore/rhel"
        "github.com/quay/claircore/suse"
 )
@@ -23,6 +24,7 @@ func NewEcosystem(ctx context.Context) *indexer.Ecosystem {
                                &oracle.DistributionScanner{},
                                &rhel.DistributionScanner{},
                                &suse.DistributionScanner{},
+                               &photon.DistributionScanner{},
                        }, nil
                },
                RepositoryScanners: func(ctx context.Context) ([]indexer.RepositoryScanner, error) {

- add support for Photon OS versions 1, 2 and 3
- uses oval files published at https://packages.vmware.com/photon/security/oval/
@ppadmavilasom ppadmavilasom force-pushed the topic/ppadmavilasom/photon_support branch from cdbfcf3 to 4b8de45 Compare March 6, 2020 21:09
@ppadmavilasom
Copy link
Contributor Author

@ldelossa i ran top level tests as well. i will check missing distribution_id maps manually (dont see tests covering it)

@ldelossa
Copy link
Contributor

ldelossa commented Mar 6, 2020

@ppadmavilasom I provided a patch. we missed the inclusion of your distribution scanner in the rpm ecosystem. Ecosystem is just a way for us to group constructors for used during the indexing of a image.

@ppadmavilasom
Copy link
Contributor Author

@ppadmavilasom I provided a patch. we missed the inclusion of your distribution scanner in the rpm ecosystem. Ecosystem is just a way for us to group constructors for used during the indexing of a image.

@ldelossa Thanks! included the patch for ecosystem and added missing libvuln/updaters

@ldelossa
Copy link
Contributor

ldelossa commented Mar 6, 2020

@ppadmavilasom looks good!
I'm cool with merging this then we will work on the matching side. Let's chat in the discussion.

@ppadmavilasom
Copy link
Contributor Author

Awesome. thank you.

@ppadmavilasom ppadmavilasom changed the title wip: photon support photon support Mar 6, 2020
@ppadmavilasom ppadmavilasom force-pushed the topic/ppadmavilasom/photon_support branch from 4b8de45 to cabfd25 Compare March 6, 2020 21:48
Copy link
Contributor

@ldelossa ldelossa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ldelossa ldelossa merged commit e45b855 into quay:master Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants