From 63b6bf3f4a8c384f4a7d4c5dc0e95046c3cea166 Mon Sep 17 00:00:00 2001 From: Aldo Lacuku Date: Tue, 30 May 2023 11:32:16 +0200 Subject: [PATCH] cleanup(cmd): remove leftover code in install and follow commands Signed-off-by: Aldo Lacuku --- cmd/artifact/follow/follow.go | 17 ----------------- cmd/artifact/install/install.go | 16 ---------------- 2 files changed, 33 deletions(-) diff --git a/cmd/artifact/follow/follow.go b/cmd/artifact/follow/follow.go index c3c669ba..366e0792 100644 --- a/cmd/artifact/follow/follow.go +++ b/cmd/artifact/follow/follow.go @@ -31,8 +31,6 @@ import ( "github.com/falcosecurity/falcoctl/cmd/artifact/install" "github.com/falcosecurity/falcoctl/internal/config" "github.com/falcosecurity/falcoctl/internal/follower" - "github.com/falcosecurity/falcoctl/internal/utils" - "github.com/falcosecurity/falcoctl/pkg/index" "github.com/falcosecurity/falcoctl/pkg/oci" "github.com/falcosecurity/falcoctl/pkg/options" "github.com/falcosecurity/falcoctl/pkg/output" @@ -250,21 +248,6 @@ func (o *artifactFollowOptions) RunArtifactFollow(ctx context.Context, args []st args = configuredFollower.Artifacts } - o.Printer.Info.Printfln("Reading all configured index files from %q", config.IndexesFile) - indexConfig, err := index.NewConfig(config.IndexesFile) - if err != nil { - return err - } - - mergedIndexes, err := utils.Indexes(indexConfig, config.IndexesDir) - if err != nil { - return err - } - - if len(mergedIndexes.Entries) < 1 { - o.Printer.Warning.Println("No configured index. Consider to configure one using the 'index add' command.") - } - var sched cron.Schedule if o.cron != "" { sched, err = cron.ParseStandard(o.cron) diff --git a/cmd/artifact/install/install.go b/cmd/artifact/install/install.go index f8379dfa..5fe4d9c0 100644 --- a/cmd/artifact/install/install.go +++ b/cmd/artifact/install/install.go @@ -26,7 +26,6 @@ import ( "github.com/falcosecurity/falcoctl/internal/config" "github.com/falcosecurity/falcoctl/internal/utils" - "github.com/falcosecurity/falcoctl/pkg/index" "github.com/falcosecurity/falcoctl/pkg/oci" "github.com/falcosecurity/falcoctl/pkg/options" ) @@ -179,21 +178,6 @@ func (o *artifactInstallOptions) RunArtifactInstall(ctx context.Context, args [] args = configuredInstaller.Artifacts } - o.Printer.Info.Printfln("Reading all configured index files from %q", config.IndexesFile) - indexConfig, err := index.NewConfig(config.IndexesFile) - if err != nil { - return err - } - - mergedIndexes, err := utils.Indexes(indexConfig, config.IndexesDir) - if err != nil { - return err - } - - if len(mergedIndexes.Entries) < 1 { - o.Printer.Warning.Println("No configured index. Consider to configure one using the 'index add' command.") - } - // Create temp dir where to put pulled artifacts tmpDir, err := os.MkdirTemp("", "falcoctl") if err != nil {