Skip to content

Commit

Permalink
cleanup(cmd): remove leftover code in install and follow commands
Browse files Browse the repository at this point in the history
Signed-off-by: Aldo Lacuku <[email protected]>
  • Loading branch information
alacuku authored and poiana committed May 31, 2023
1 parent a397401 commit 63b6bf3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
17 changes: 0 additions & 17 deletions cmd/artifact/follow/follow.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down
16 changes: 0 additions & 16 deletions cmd/artifact/install/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 63b6bf3

Please sign in to comment.