falcosecurity / falcoctl

Administrative tooling for Falco
Apache License 2.0
82 stars 57 forks source link

feat: Add file backend to fetcher #555

Closed kpaulisse closed 1 month ago

kpaulisse commented 1 month ago

What type of PR is this?

/kind feature

Any specific area of the project related to this PR?

What this PR does / why we need it:

This PR adds a "local file" storage backend for the index file.

To keep consistent with the existing design, this is specified by file:///some/directory/my-index.yaml which allows the existing code to correctly guess the storage backend.

I wrote a test covering the new backend as well.

Reason we need this: We want to use falcoctl in environments to help build configuration artifacts in environments that may not have internet access, so a local file works better for us.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

alacuku commented 1 month ago

Hi @kpaulisse, thanks for the contribution!

Could you have a look at linting?

kpaulisse commented 1 month ago

@alacuku Sure, I fixed the lint complaints and rebased this on the latest main for you.

poiana commented 1 month ago

LGTM label has been added.

Git tree hash: c4b7f7d28963bb59a6d69c5a20e502368e542baf

poiana commented 1 month ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alacuku, kpaulisse

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/falcosecurity/falcoctl/blob/main/OWNERS)~~ [alacuku] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment