rename to syft

This commit is contained in:
Alex Goodman
2020-07-23 20:54:04 -04:00
parent 2132700198
commit a4016d35ce
192 changed files with 241 additions and 239 deletions
+3 -3
View File
@@ -6,9 +6,9 @@ import (
"strings"
"github.com/adrg/xdg"
"github.com/anchore/imgbom/imgbom/presenter"
"github.com/anchore/imgbom/imgbom/scope"
"github.com/anchore/imgbom/internal"
"github.com/anchore/syft/internal"
"github.com/anchore/syft/syft/presenter"
"github.com/anchore/syft/syft/scope"
"github.com/mitchellh/go-homedir"
"github.com/spf13/viper"
"go.uber.org/zap/zapcore"
+1 -1
View File
@@ -1,4 +1,4 @@
package internal
// note: must be a single word, all lowercase
const ApplicationName = "imgbom"
const ApplicationName = "syft"
+2 -2
View File
@@ -6,9 +6,9 @@ import (
"os"
"sort"
"github.com/anchore/imgbom/internal"
"github.com/anchore/syft/internal"
"github.com/anchore/imgbom/internal/log"
"github.com/anchore/syft/internal/log"
)
type ZipFileManifest map[string]os.FileInfo
+1 -1
View File
@@ -11,7 +11,7 @@ import (
"path/filepath"
"strings"
"github.com/anchore/imgbom/internal/log"
"github.com/anchore/syft/internal/log"
)
const (
+4 -4
View File
@@ -67,7 +67,7 @@ func equal(r1, r2 io.Reader) (bool, error) {
}
func TestUnzipToDir(t *testing.T) {
archivePrefix, err := ioutil.TempFile("", "imgbom-ziputil-archive-TEST-")
archivePrefix, err := ioutil.TempFile("", "syft-ziputil-archive-TEST-")
if err != nil {
t.Fatalf("unable to create tempfile: %+v", err)
}
@@ -79,7 +79,7 @@ func TestUnzipToDir(t *testing.T) {
generateFixture(t, archivePrefix.Name())
contentsDir, err := ioutil.TempDir("", "imgbom-ziputil-contents-TEST-")
contentsDir, err := ioutil.TempDir("", "syft-ziputil-contents-TEST-")
if err != nil {
t.Fatalf("unable to create tempdir: %+v", err)
}
@@ -162,7 +162,7 @@ func TestUnzipToDir(t *testing.T) {
}
func TestExtractFilesFromZipFile(t *testing.T) {
archivePrefix, err := ioutil.TempFile("", "imgbom-ziputil-archive-TEST-")
archivePrefix, err := ioutil.TempFile("", "syft-ziputil-archive-TEST-")
if err != nil {
t.Fatalf("unable to create tempfile: %+v", err)
}
@@ -211,7 +211,7 @@ func TestExtractFilesFromZipFile(t *testing.T) {
}
func TestZipFileManifest(t *testing.T) {
archivePrefix, err := ioutil.TempFile("", "imgbom-ziputil-archive-TEST-")
archivePrefix, err := ioutil.TempFile("", "syft-ziputil-archive-TEST-")
if err != nil {
t.Fatalf("unable to create tempfile: %+v", err)
}
+1 -1
View File
@@ -1,6 +1,6 @@
package log
import "github.com/anchore/imgbom/imgbom/logger"
import "github.com/anchore/syft/syft/logger"
var Log logger.Logger = &nopLogger{}
+1 -1
View File
@@ -3,7 +3,7 @@ package logger
import (
"os"
"github.com/anchore/imgbom/internal/format"
"github.com/anchore/syft/internal/format"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
+2 -2
View File
@@ -4,13 +4,13 @@ import (
"fmt"
"os"
imgbomEventParsers "github.com/anchore/imgbom/imgbom/event/parsers"
syftEventParsers "github.com/anchore/syft/syft/event/parsers"
"github.com/wagoodman/go-partybus"
)
func CatalogerFinishedHandler(event partybus.Event) error {
// show the report to stdout
pres, err := imgbomEventParsers.ParseCatalogerFinished(event)
pres, err := syftEventParsers.ParseCatalogerFinished(event)
if err != nil {
return fmt.Errorf("bad CatalogerFinished event: %w", err)
}
+6 -6
View File
@@ -6,10 +6,10 @@ import (
"os"
"sync"
imgbomEvent "github.com/anchore/imgbom/imgbom/event"
"github.com/anchore/imgbom/internal/log"
"github.com/anchore/imgbom/internal/ui/common"
stereoscopeEvent "github.com/anchore/stereoscope/pkg/event"
"github.com/anchore/syft/internal/log"
"github.com/anchore/syft/internal/ui/common"
syftEvent "github.com/anchore/syft/syft/event"
"github.com/wagoodman/go-partybus"
"github.com/wagoodman/jotframe/pkg/frame"
)
@@ -68,7 +68,7 @@ eventLoop:
break eventLoop
}
switch e.Type {
case imgbomEvent.AppUpdateAvailable:
case syftEvent.AppUpdateAvailable:
err = appUpdateAvailableHandler(ctx, fr, e, wg)
if err != nil {
log.Errorf("unable to show AppUpdateAvailable event: %+v", err)
@@ -86,12 +86,12 @@ eventLoop:
log.Errorf("unable to show FetchImage event: %+v", err)
}
case imgbomEvent.CatalogerStarted:
case syftEvent.CatalogerStarted:
err = catalogerStartedHandler(ctx, fr, e, wg)
if err != nil {
log.Errorf("unable to show CatalogerStarted event: %+v", err)
}
case imgbomEvent.CatalogerFinished:
case syftEvent.CatalogerFinished:
// we may have other background processes still displaying progress, wait for them to
// finish before discontinuing dynamic content and showing the final report
wg.Wait()
+3 -3
View File
@@ -7,8 +7,8 @@ import (
"sync"
"time"
imgbomEventParsers "github.com/anchore/imgbom/imgbom/event/parsers"
stereoEventParsers "github.com/anchore/stereoscope/pkg/event/parsers"
syftEventParsers "github.com/anchore/syft/syft/event/parsers"
"github.com/gookit/color"
"github.com/wagoodman/go-partybus"
"github.com/wagoodman/go-progress"
@@ -111,7 +111,7 @@ func imageReadHandler(ctx context.Context, fr *frame.Frame, event partybus.Event
}
func catalogerStartedHandler(ctx context.Context, fr *frame.Frame, event partybus.Event, wg *sync.WaitGroup) error {
monitor, err := imgbomEventParsers.ParseCatalogerStarted(event)
monitor, err := syftEventParsers.ParseCatalogerStarted(event)
if err != nil {
return fmt.Errorf("bad CatalogerStarted event: %w", err)
}
@@ -145,7 +145,7 @@ func catalogerStartedHandler(ctx context.Context, fr *frame.Frame, event partybu
}
func appUpdateAvailableHandler(_ context.Context, fr *frame.Frame, event partybus.Event, _ *sync.WaitGroup) error {
newVersion, err := imgbomEventParsers.ParseAppUpdateAvailable(event)
newVersion, err := syftEventParsers.ParseAppUpdateAvailable(event)
if err != nil {
return fmt.Errorf("bad AppUpdateAvailable event: %w", err)
}
+4 -4
View File
@@ -1,9 +1,9 @@
package ui
import (
imgbomEvent "github.com/anchore/imgbom/imgbom/event"
"github.com/anchore/imgbom/internal/log"
"github.com/anchore/imgbom/internal/ui/common"
"github.com/anchore/syft/internal/log"
"github.com/anchore/syft/internal/ui/common"
syftEvent "github.com/anchore/syft/syft/event"
"github.com/wagoodman/go-partybus"
)
@@ -23,7 +23,7 @@ eventLoop:
}
// ignore all events except for the final event
if e.Type == imgbomEvent.CatalogerFinished {
if e.Type == syftEvent.CatalogerFinished {
err := common.CatalogerFinishedHandler(e)
if err != nil {
log.Errorf("unable to show catalog image finished event: %+v", err)
+1 -1
View File
@@ -4,7 +4,7 @@ import (
"os"
"runtime"
"github.com/anchore/imgbom/internal/ui/etui"
"github.com/anchore/syft/internal/ui/etui"
"golang.org/x/crypto/ssh/terminal"
)
+1 -1
View File
@@ -15,7 +15,7 @@ var latestAppVersionURL = struct {
}{
// TODO: set me to release host/path before release
host: "https://anchore.io",
path: "/imgbom/releases/latest/VERSION",
path: "/syft/releases/latest/VERSION",
}
func IsUpdateAvailable() (bool, string, error) {