Conversation
|
About (ok this is a super stupid example btw!) |
4bc454c to
8503a93
Compare
|
Example output: |
8b8730b to
fceb81a
Compare
| go fmt ./... | ||
| find . -type f -name '*.go' -a -exec $(GCI) write -s standard -s default -s "prefix(github.com/falcosecurity/falcoctl)" {} \; | ||
| find . -type f -name '*.go' -exec $(ADDLICENSE) -l apache -c "The Falco Authors" -y "$(shell date +%Y)" {} \; | ||
| find . -type f -name '*.go' -exec $(ADDLICENSE) -l apache -s -c "The Falco Authors" -y "$(shell date +%Y)" {} \; |
There was a problem hiding this comment.
-s Include SPDX identifier in license header. Set -s=only to only include SPDX identifier.
| ) | ||
|
|
||
| // NewDriverCmd returns the driver command. | ||
| func NewDriverCmd(ctx context.Context, opt *commonoptions.Common) *cobra.Command { |
There was a problem hiding this comment.
driver subcmd is only available on linux systems.
|
|
||
| // NewDriverCmd returns an empty driver command since it is not supported on non linuxes | ||
| func NewDriverCmd(ctx context.Context, opt *commonoptions.Common) *cobra.Command { | ||
| return &cobra.Command{} |
There was a problem hiding this comment.
By returning an empty command, cobra will skip it.
cmd/driver/prepare/prepare.go
Outdated
|
|
||
| d, err := driverdistro.DiscoverDistro(o.Printer, o.HostRoot) | ||
| if err != nil { | ||
| if errors.Is(err, driverdistro.ErrUnsupported) && o.Build { |
There was a problem hiding this comment.
errUnsupported returns a generic distro, to attempt a build.
|
What is implemented so far:
What we miss:
Open points:
|
|
/hold |
alacuku
left a comment
There was a problem hiding this comment.
Thanks for the PR, left some comments.
d831e84 to
cc6443f
Compare
|
I consider this PR ready! |
c45fcb7 to
25aeda1
Compare
|
Squashed to a single commit :) @alacuku is now happy 😃 |
25aeda1 to
faefd7d
Compare
It exposes 4 subcmds: * `install` to install (ie: either download or build) kmod or eBPF probe * `cleanup` to cleanup a driver * `printenv` to print environment variables about driver-loader * `config` to configure the driver-loader feature Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
faefd7d to
1c40175
Compare
|
/unhold |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alacuku, FedeDP, maxgio92 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Great job @FedeDP! 👏🏻 ❤️ |
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
What type of PR is this?
/kind feature
Any specific area of the project related to this PR?
/area library
/area cli
What this PR does / why we need it:
First draft at implementing
falcoctl drivercommand, see #327Which issue(s) this PR fixes:
Eventually #327 will get fixed, but i don't think a single PR will make it :)
Fixes #
Special notes for your reviewer:
What we need:
selectsubcmd with possibility for an "autoselection" smart logic in place; this is not required by Falco but might be useful for other consumers of the falcoctl libraries and for us in the futureselectstores the currently selected driver in the falcoctl configselectmust be able to communicate to Falco the driver it must use (we need a patch to allow Falco config to specify a driver to be used) -> new: driver selection in falco.yaml falco#2413 -> this is implemented in falcoctl, even if will need some more fixesselecttestsprepareskeleton (this will be the step where we either download or build the drivers)autoload of targetRetired with new: driver command #343 (comment)driverversionfrom running Falco process, if anypreparedownloadpreparebuildget_target_idfalco-driver-loader function)preparetestsecho " DRIVER_INSECURE_DOWNLOAD whether you want to allow insecure downloads or not"-> DEPRECATEDecho " DRIVER_CURL_OPTIONS specify additional options to be passed to curl command used to download Falco drivers"echo " DRIVER_KERNEL_RELEASE specify the kernel release for which to download/build the driver in the same format used by 'uname -r' (e.g. '6.1.0-10-cloud-amd64')"echo " DRIVER_KERNEL_VERSION specify the kernel version for which to download/build the driver in the same format used by 'uname -v' (e.g. '#1 SMP PREEMPT_DYNAMIC Debian 6.1.38-2 (2023-07-27)')"