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: split apk out of alpine #1070

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion alpine/ecosystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package alpine
import (
"context"

"github.com/quay/claircore/apk"
"github.com/quay/claircore/indexer"
"github.com/quay/claircore/linux"
)
Expand All @@ -11,7 +12,7 @@ import (
func NewEcosystem(ctx context.Context) *indexer.Ecosystem {
return &indexer.Ecosystem{
PackageScanners: func(ctx context.Context) ([]indexer.PackageScanner, error) {
return []indexer.PackageScanner{&Scanner{}}, nil
return []indexer.PackageScanner{&apk.Scanner{}}, nil
},
DistributionScanners: func(ctx context.Context) ([]indexer.DistributionScanner, error) {
return []indexer.DistributionScanner{&DistributionScanner{}}, nil
Expand Down
18 changes: 9 additions & 9 deletions alpine/packagescanner.go → apk/scanner.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package alpine
package apk

import (
"bytes"
Expand All @@ -15,9 +15,9 @@ import (
)

const (
pkgName = `apk`
pkgVersion = `v0.0.1`
pkgKind = `package`
name = "apk"
version = "v0.0.1"
kind = "package"
)

var (
Expand All @@ -31,13 +31,13 @@ var (
type Scanner struct{}

// Name implements indexer.VersionedScanner.
func (*Scanner) Name() string { return pkgName }
func (*Scanner) Name() string { return name }

// Version implements indexer.VersionedScanner.
func (*Scanner) Version() string { return pkgVersion }
func (*Scanner) Version() string { return version }

// Kind implements indexer.VersionedScanner.
func (*Scanner) Kind() string { return pkgKind }
func (*Scanner) Kind() string { return kind }

const installedFile = "lib/apk/db/installed"

Expand All @@ -52,8 +52,8 @@ func (*Scanner) Scan(ctx context.Context, layer *claircore.Layer) ([]*claircore.
defer trace.StartRegion(ctx, "Scanner.Scan").End()
trace.Log(ctx, "layer", layer.Hash.String())
ctx = zlog.ContextWithValues(ctx,
"component", "alpine/Scanner.Scan",
"version", pkgVersion,
"component", "apk/Scanner.Scan",
"version", version,
"layer", layer.Hash.String())

zlog.Debug(ctx).Msg("start")
Expand Down
2 changes: 1 addition & 1 deletion alpine/packagescanner_test.go → apk/scanner_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package alpine
package apk

import (
"context"
Expand Down