Skip to content

Commit

Permalink
refactores to notes
Browse files Browse the repository at this point in the history
  • Loading branch information
mchmarny committed Mar 5, 2023
1 parent 094c4dd commit 51a2d96
Show file tree
Hide file tree
Showing 10 changed files with 155 additions and 347 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/on-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
gh -R "$GITHUB_REPOSITORY" release download "$GITHUB_REF_NAME" -p "*.tar.gz"
gh -R "$GITHUB_REPOSITORY" release download "$GITHUB_REF_NAME" -p "vulctl*"
gh -R "$GITHUB_REPOSITORY" release download "$GITHUB_REF_NAME" -p "multiple.intoto.jsonl"
- name: Verify Assets
env:
Expand Down
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.0.10
v0.0.11
4 changes: 2 additions & 2 deletions cmd/vulctl/cli/import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ func TestImport(t *testing.T) {
assert.Error(t, err)

set.String(sourceFlag.Name, "us-docker.pkg.dev/project/repo/img@sha256:f6efe...", "")
set.String(fileFlag.Name, "../../../data/grype.json", "")
set.String(formatFlag.Name, "grype", "")
set.String(fileFlag.Name, "../../../data/snyk.json", "")
set.String(formatFlag.Name, "snyk", "")

c = cli.NewContext(newTestApp(t), set, nil)
err = importCmd(c)
Expand Down
7 changes: 2 additions & 5 deletions pkg/convert/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,19 @@ package convert
import (
"context"

"github.com/mchmarny/vulctl/pkg/convert/grype"
"github.com/mchmarny/vulctl/pkg/convert/snyk"
"github.com/mchmarny/vulctl/pkg/src"
"github.com/mchmarny/vulctl/pkg/types"
"github.com/pkg/errors"
aa "google.golang.org/api/containeranalysis/v1"
)

// VulnerabilityConverter is a function that converts a source to a list of occurrences.
type VulnerabilityConverter func(ctx context.Context, s *src.Source) ([]*aa.Occurrence, error)
// VulnerabilityConverter is a function that converts a source to a list of AA notes.
type VulnerabilityConverter func(ctx context.Context, s *src.Source) ([]*aa.Note, error)

// GetConverter returns a vulnerability converter for the given format.
func GetConverter(format types.SourceFormat) (VulnerabilityConverter, error) {
switch format {
case types.SourceFormatGrypeJSON:
return grype.Convert, nil
case types.SourceFormatSnykJSON:
return snyk.Convert, nil
default:
Expand Down
228 changes: 0 additions & 228 deletions pkg/convert/grype/converter.go

This file was deleted.

34 changes: 0 additions & 34 deletions pkg/convert/grype/converter_test.go

This file was deleted.

Loading

0 comments on commit 51a2d96

Please sign in to comment.