Documentation
¶
Overview ¶
Package follower defines the Follower type. It is used to track a specific artifact version denoted by its tag. Periodically it checks if a new version has been pushed and if so pulls and installs it in a given directory. Each Follower can track only one artifact, if you need to track multiple artiacts then instantiate a follower for each one.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
WaitGroup *sync.WaitGroup
// CloseChan used to close the follower.
CloseChan <-chan bool
// Resync time after which periodically it checks for new a new version.
Resync cron.Schedule
// RulesfilesDir directory where the rulesfile are stored.
RulesfilesDir string
// PluginsDir directory where plugins are stored.
PluginsDir string
// AssetsDir directory where assets are stored.
AssetsDir string
// StateDir directory where artifact state is persisted.
StateDir string
// ArtifactReference reference to the artifact in a remote repository.
ArtifactReference string
// PlainHTTP is set to true if all registry interaction must be in plain http.
PlainHTTP bool
// TmpDir directory where to save temporary files.
TmpDir string
// FalcoVersions is a struct containing all the required Falco versions that this follower
// has to take into account when installing artifacts.
FalcoVersions config.FalcoVersions
// AllowedTypes specify a list of artifacts that we are allowed to download.
AllowedTypes oci.ArtifactTypeSlice
// Signature has the data needed for signature checking
Signature *index.Signature
// StartupBehavior controls what happens on the first follow invocation.
StartupBehavior StartupBehavior
// StartupMaxDelay is the maximum random delay applied before the first follow
// when StartupBehavior is StartupBehaviorJitter.
StartupMaxDelay time.Duration
}
Config configuration options for the Follower.
type Follower ¶
type Follower struct {
*ocipuller.Puller
*Config
config.FalcoVersions
*output.Printer
// contains filtered or unexported fields
}
Follower knows how to track an artifact in a remote repository given the reference. It starts a new goroutine to check for updates periodically. If an update is available it pulls the new version and installs it in the correct directory.
type StartupBehavior ¶ added in v0.12.0
type StartupBehavior string
StartupBehavior defines the behavior of the follower at startup.
const ( // StartupBehaviorSkip skips the first follow; the first run will happen on // the first scheduled version check. StartupBehaviorSkip StartupBehavior = "skip" // StartupBehaviorJitter adds a random delay before the first version check // up to StartupMaxDelay. StartupBehaviorJitter StartupBehavior = "jitter" // StartupBehaviorImmediate performs the first version check immediately. StartupBehaviorImmediate StartupBehavior = "immediate" )