Skip to content

Commit

Permalink
fix linting warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
  • Loading branch information
matthyx committed Mar 21, 2023
1 parent d41bf99 commit d47e917
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion adapters/mockplatform.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (m MockPlatform) SendStatus(ctx context.Context, step int) error {
}

// SubmitCVE logs the given ID for CVE calculation
func (m MockPlatform) SubmitCVE(ctx context.Context, cve domain.CVEManifest, cvep domain.CVEManifest) error {
func (m MockPlatform) SubmitCVE(_ context.Context, cve domain.CVEManifest, _ domain.CVEManifest) error {
logger.L().Info(
"SubmitCVE",
helpers.String("ID", cve.ID),
Expand Down
16 changes: 8 additions & 8 deletions cmd/http/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
func main() {
ctx := context.Background()

config, err := config.LoadConfig("/etc/config")
c, err := config.LoadConfig("/etc/config")
if err != nil {
logger.L().Ctx(ctx).Fatal("load config error", helpers.Error(err))
}
Expand All @@ -33,8 +33,8 @@ func main() {
if otelHost, present := os.LookupEnv("OTEL_COLLECTOR_SVC"); present {
ctx = logger.InitOtel("kubevuln",
os.Getenv("RELEASE"),
config.AccountID,
config.ClusterName,
c.AccountID,
c.ClusterName,
url.URL{Host: otelHost})
defer logger.ShutdownOtel(ctx)
}
Expand All @@ -44,17 +44,17 @@ func main() {
defer stop()

var storage *repositories.APIServerStore
if config.Storage {
if c.Storage {
storage, err = repositories.NewAPIServerStorage("kubescape")
if err != nil {
logger.L().Ctx(ctx).Fatal("storage initialization error", helpers.Error(err))
}
}
sbomAdapter := v1.NewSyftAdapter(config.ScanTimeout)
sbomAdapter := v1.NewSyftAdapter(c.ScanTimeout)
cveAdapter := v1.NewGrypeAdapter()
platform := v1.NewArmoAdapter(config.AccountID, config.BackendOpenAPI, config.EventReceiverRestURL)
service := services.NewScanService(sbomAdapter, storage, cveAdapter, storage, platform, config.Storage)
controller := controllers.NewHTTPController(service, config.ScanConcurrency)
platform := v1.NewArmoAdapter(c.AccountID, c.BackendOpenAPI, c.EventReceiverRestURL)
service := services.NewScanService(sbomAdapter, storage, cveAdapter, storage, platform, c.Storage)
controller := controllers.NewHTTPController(service, c.ScanConcurrency)

gin.SetMode(gin.ReleaseMode)
router := gin.New()
Expand Down
2 changes: 1 addition & 1 deletion repositories/broken.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (b BrokenStore) GetCVE(ctx context.Context, _ string, _ string, _ string, _
return domain.CVEManifest{}, errors.New("expected error")
}

func (b BrokenStore) StoreCVE(ctx context.Context, cve domain.CVEManifest, withRelevancy bool) error {
func (b BrokenStore) StoreCVE(ctx context.Context, _ domain.CVEManifest, _ bool) error {
ctx, span := otel.Tracer("").Start(ctx, "BrokenStore.StoreCVE")
defer span.End()
return errors.New("expected error")
Expand Down
2 changes: 1 addition & 1 deletion repositories/memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (m *MemoryStore) GetCVE(ctx context.Context, imageID, SBOMCreatorVersion, C
}

// StoreCVE stores a CVE manifest to an in-memory map
func (m *MemoryStore) StoreCVE(ctx context.Context, cve domain.CVEManifest, withRelevancy bool) error {
func (m *MemoryStore) StoreCVE(ctx context.Context, cve domain.CVEManifest, _ bool) error {
ctx, span := otel.Tracer("").Start(ctx, "MemoryStore.StoreCVE")
defer span.End()

Expand Down

0 comments on commit d47e917

Please sign in to comment.