Skip to content

feat: added a shared artifact state between install and follow to avoid redundant pull#870

Merged
poiana merged 4 commits intofalcosecurity:mainfrom
c2ndev:feat/shared-artifact-state-install-follow
Jan 14, 2026
Merged

feat: added a shared artifact state between install and follow to avoid redundant pull#870
poiana merged 4 commits intofalcosecurity:mainfrom
c2ndev:feat/shared-artifact-state-install-follow

Conversation

@c2ndev
Copy link
Copy Markdown
Contributor

@c2ndev c2ndev commented Dec 23, 2025

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

/kind flaky-test

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area library

/area cli

/area tests

/area examples

What this PR does / why we need it:
In a Kubernetes deployment, falcoctl is often used in two different phases:

  1. install — running in an initContainer
  2. follow — running in a sidecar

Currently, the first execution of the follower starts from a blank state, which causes artifacts that were already installed to be resolved and pulled again.

To avoid this behavior, this PR enforces a shared state within the artifact volumes, allowing the follower to be aware of previously installed artifacts. This reduces redundant pulls and the load on the container registry.

Which issue(s) this PR fixes:

Fixes #866

Special notes for your reviewer:

@poiana poiana requested review from alacuku and maxgio92 December 23, 2025 09:57
@c2ndev c2ndev changed the title wip: feat: added a shared artifact state between install and follow to avoid redundant pull feat: added a shared artifact state between install and follow to avoid redundant pull Jan 13, 2026
leogr
leogr previously approved these changes Jan 14, 2026
Copy link
Copy Markdown
Member

@leogr leogr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

return err
}

return os.WriteFile(path, b, filePerm)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit - very minor recommendation here.

os.WriteFile is not atomic (it truncates and writes using a buffer), so if multiple falcoctl processes read and write simultaneously to the same state file, a reader could see the state file in a corrupted state.

However, the read function (above) handles corrupted JSON gracefully, and since the "best-effort" nature of this "cache" mechanism, I don't see this as a blocker for this PR. We may improve it later.

@github-project-automation github-project-automation bot moved this from Todo to In progress in Falco Roadmap Jan 14, 2026
@poiana poiana added the lgtm label Jan 14, 2026
@poiana
Copy link
Copy Markdown
Contributor

poiana commented Jan 14, 2026

LGTM label has been added.

DetailsGit tree hash: 3f37b25b8a80399fc12299fcca60d755b5c5a3c3

Signed-off-by: c2ndev <cannarella.dev@gmail.com>
Signed-off-by: c2ndev <cannarella.dev@gmail.com>
… a watched folder of Falco, improve tests

Signed-off-by: c2ndev <cannarella.dev@gmail.com>
Signed-off-by: cannarelladev <cannarella.dev@gmail.com>
@c2ndev c2ndev force-pushed the feat/shared-artifact-state-install-follow branch from ac57789 to 90ac983 Compare January 14, 2026 13:56
@poiana poiana removed the lgtm label Jan 14, 2026
@poiana poiana requested a review from leogr January 14, 2026 13:56
@poiana poiana added the lgtm label Jan 14, 2026
@poiana
Copy link
Copy Markdown
Contributor

poiana commented Jan 14, 2026

LGTM label has been added.

DetailsGit tree hash: 6b3630fb642cd9a446de6676b8d11aceb858d2eb

@poiana
Copy link
Copy Markdown
Contributor

poiana commented Jan 14, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: c2ndev, leogr

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

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana merged commit 57ee5a9 into falcosecurity:main Jan 14, 2026
17 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in Falco Roadmap Jan 14, 2026
@leogr leogr added this to the v0.12.0 milestone Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Persist artifact state to optimize follower startup and reduce registry requests

3 participants