Skip to content

Commit 313f047

Browse files
FedeDPpoiana
authored andcommitted
chore(cmd/driver): add preview to all driver related commands.
Signed-off-by: Federico Di Pierro <[email protected]>
1 parent 15aa180 commit 313f047

File tree

7 files changed

+42
-13
lines changed

7 files changed

+42
-13
lines changed

cmd/driver/cleanup/cleanup.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ func NewDriverCleanupCmd(ctx context.Context, opt *options.Common) *cobra.Comman
3636
cmd := &cobra.Command{
3737
Use: "cleanup [flags]",
3838
DisableFlagsInUseLine: true,
39-
Short: "Cleanup a driver",
40-
Long: "Cleans a driver up, eg for kmod, by removing it from dkms.",
39+
Short: "[Preview] Cleanup a driver",
40+
Long: `[Preview] Cleans a driver up, eg for kmod, by removing it from dkms.
41+
** This command is in preview and under development. **`,
4142
RunE: func(cmd *cobra.Command, args []string) error {
4243
return o.RunDriverCleanup(ctx)
4344
},

cmd/driver/config/config.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ import (
4343

4444
const (
4545
configMapEngineKindKey = "engine.kind"
46-
longConfig = `Configure a driver for future usages with other driver subcommands.
46+
longConfig = `[Preview] Configure a driver for future usages with other driver subcommands.
4747
It will also update local Falco configuration or k8s configmap depending on the environment where it is running, to let Falco use chosen driver.
4848
Only supports deployments of Falco that use a driver engine, ie: one between kmod, ebpf and modern-ebpf.
4949
If engine.kind key is set to a non-driver driven engine, Falco configuration won't be touched.
50+
** This command is in preview and under development. **
5051
`
5152
)
5253

@@ -72,7 +73,7 @@ func NewDriverConfigCmd(ctx context.Context, opt *options.Common) *cobra.Command
7273
cmd := &cobra.Command{
7374
Use: "config [flags]",
7475
DisableFlagsInUseLine: true,
75-
Short: "Configure a driver",
76+
Short: "[Preview] Configure a driver",
7677
Long: longConfig,
7778
RunE: func(cmd *cobra.Command, args []string) error {
7879
return o.RunDriverConfig(ctx, cmd)

cmd/driver/config/config_test.go

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,31 @@ import (
2525
"github.com/falcosecurity/falcoctl/cmd"
2626
)
2727

28-
var driverConfigHelp = `Configure a driver for future usages with other driver subcommands.`
28+
var driverConfigHelp = `[Preview] Configure a driver for future usages with other driver subcommands.
29+
It will also update local Falco configuration or k8s configmap depending on the environment where it is running, to let Falco use chosen driver.
30+
Only supports deployments of Falco that use a driver engine, ie: one between kmod, ebpf and modern-ebpf.
31+
If engine.kind key is set to a non-driver driven engine, Falco configuration won't be touched.
32+
** This command is in preview and under development. **
33+
34+
Usage:
35+
falcoctl driver config [flags]
36+
37+
Flags:
38+
-h, --help help for config
39+
--host-root string Driver host root to be configured. (default "/")
40+
--kubeconfig string Kubernetes config.
41+
--name string Driver name to be configured. (default "falco")
42+
--namespace string Kubernetes namespace.
43+
--repo strings Driver repo to be configured. (default [https://download.falco.org/driver])
44+
--type string Driver type to be configured (auto, ebpf, kmod, modern_ebpf) (default "kmod")
45+
--update-falco Whether to update Falco config/configmap. (default true)
46+
--version string Driver version to be configured.
47+
48+
Global Flags:
49+
--config string config file to be used for falcoctl (default "/etc/falcoctl/falcoctl.yaml")
50+
--log-format string Set formatting for logs (color, text, json) (default "color")
51+
--log-level string Set level for logs (info, warn, debug, trace) (default "info")
52+
`
2953

3054
var addAssertFailedBehavior = func(specificError string) {
3155
It("check that fails and the usage is not printed", func() {
@@ -58,7 +82,7 @@ var _ = Describe("config", func() {
5882
})
5983

6084
It("should match the saved one", func() {
61-
Expect(output).Should(gbytes.Say(driverConfigHelp))
85+
Expect(output).Should(gbytes.Say(regexp.QuoteMeta(driverConfigHelp)))
6286
})
6387
})
6488

cmd/driver/driver_linux.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ func NewDriverCmd(ctx context.Context, opt *commonoptions.Common) *cobra.Command
3636
cmd := &cobra.Command{
3737
Use: "driver",
3838
DisableFlagsInUseLine: true,
39-
Short: "Interact with falcosecurity driver",
40-
Long: "Interact with falcosecurity driver",
39+
Short: "[Preview] Interact with falcosecurity driver",
40+
Long: `[Preview] Interact with falcosecurity driver.
41+
** This command is in preview and under development. **`,
4142
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
4243
opt.Initialize()
4344
return config.Load(opt.ConfigFile)

cmd/driver/install/install.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ func NewDriverInstallCmd(ctx context.Context, opt *options.Common) *cobra.Comman
6060
cmd := &cobra.Command{
6161
Use: "install [flags]",
6262
DisableFlagsInUseLine: true,
63-
Short: "Install previously configured driver",
64-
Long: "Install previously configured driver, either downloading it or attempting a build",
63+
Short: "[Preview] Install previously configured driver",
64+
Long: `[Preview] Install previously configured driver, either downloading it or attempting a build.
65+
** This command is in preview and under development. **`,
6566
RunE: func(cmd *cobra.Command, args []string) error {
6667
driver, err := config.Driverer()
6768
if err != nil {

cmd/driver/printenv/printenv.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ func NewDriverPrintenvCmd(ctx context.Context, opt *options.Common) *cobra.Comma
4141
cmd := &cobra.Command{
4242
Use: "printenv [flags]",
4343
DisableFlagsInUseLine: true,
44-
Short: "Print env vars",
45-
Long: "Print variables used by driver as env vars.",
44+
Short: "[Preview] Print env vars",
45+
Long: `[Preview] Print variables used by driver as env vars.
46+
** This command is in preview and under development. **`,
4647
RunE: func(cmd *cobra.Command, args []string) error {
4748
return o.RunDriverPrintenv(ctx)
4849
},

cmd/root_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Usage:
4444
Available Commands:
4545
artifact Interact with Falco artifacts
4646
completion Generate the autocompletion script for the specified shell
47-
driver Interact with falcosecurity driver
47+
driver [Preview] Interact with falcosecurity driver
4848
help Help about any command
4949
index Interact with index
5050
registry Interact with OCI registries

0 commit comments

Comments
 (0)