import "istio.io/istio/galley/pkg/config/processing/snapshotter"
analyzingdistributor.go distributor.go snapshot.go snapshotoptions.go snapshotter.go statusupdater.go
type AnalysisSuppression struct { // Code is the analysis code to suppress (e.g. "IST0104"). Code string // ResourceName is the name of the resource to suppress the message for. For // K8s resources it has the same form as used by istioctl (e.g. // "DestinationRule default.istio-system"). Note that globbing wildcards are // supported (e.g. "DestinationRule *.istio-system"). ResourceName string }
AnalysisSuppression describes a resource and analysis code to be suppressed (e.g. ignored) during analysis. Used when a particular message code is to be ignored for a specific resource.
type AnalyzingDistributor struct {
// contains filtered or unexported fields
}
AnalyzingDistributor is an snapshotter. Distributor implementation that will perform analysis on a snapshot before publishing. It will update the CRD status with the analysis results.
func NewAnalyzingDistributor(s AnalyzingDistributorSettings) *AnalyzingDistributor
NewAnalyzingDistributor returns a new instance of AnalyzingDistributor.
func (d *AnalyzingDistributor) Distribute(name string, s *Snapshot)
Distribute implements snapshotter.Distributor
type AnalyzingDistributorSettings struct { // The status updater to route diagnostic messages to StatusUpdater StatusUpdater // The top-level combined analyzer that will perform the analysis Analyzer *analysis.CombinedAnalyzer // The downstream distributor to call, after the analysis is done. Distributor Distributor // The snapshots that will get analyzed. AnalysisSnapshots []string // The snapshot that will trigger the analysis. // TODO(https://github.com/istio/istio/issues/17543): This should be eventually replaced by the AnalysisSnapshots // and a matching debounce mechanism. TriggerSnapshot string // An optional hook that will be called whenever a collection is accessed. Useful for testing. CollectionReporter CollectionReporterFn // Namespaces that should be analyzed AnalysisNamespaces []resource.Namespace // Suppressions that suppress a set of matching messages. Suppressions []AnalysisSuppression }
AnalyzingDistributorSettings are settings for an AnalyzingDistributor
type CollectionReporterFn func(collection.Name)
CollectionReporterFn is a hook function called whenever a collection is accessed through the AnalyzingDistributor's context
Distributor interface abstracts the snapshotImpl distribution mechanism. Typically, this is implemented by the MCP layer.
type InMemoryDistributor struct {
// contains filtered or unexported fields
}
InMemoryDistributor is an in-memory Distributor implementation.
func NewInMemoryDistributor() *InMemoryDistributor
NewInMemoryDistributor returns a new instance of InMemoryDistributor
func (d *InMemoryDistributor) Distribute(name string, s *Snapshot)
Distribute is an implementation of Distributor.Distribute
func (d *InMemoryDistributor) GetSnapshot(name string) snapshot.Snapshot
GetSnapshot get the snapshotImpl of the specified name
func (d *InMemoryDistributor) NumSnapshots() int
NumSnapshots returns the current number of snapshots.
type InMemoryStatusUpdater struct { WaitTimeout time.Duration // contains filtered or unexported fields }
InMemoryStatusUpdater is an in-memory implementation of StatusUpdater
func (u *InMemoryStatusUpdater) Get() diag.Messages
Get returns the current set of captured diag.Messages
func (u *InMemoryStatusUpdater) Update(m diag.Messages)
Update implements StatusUpdater
func (u *InMemoryStatusUpdater) WaitForReport(cancelCh chan struct{}) error
WaitForReport blocks until a report is available. Returns nil if a report is available, or an error representing why we couldn't get it.
type MCPDistributor struct {
// contains filtered or unexported fields
}
MCPDistributor distributes a snapshot to the MCP layer.
func NewMCPDistributor(c *snapshot.Cache) *MCPDistributor
NewMCPDistributor returns a new instance of MCPDistributor
func (d *MCPDistributor) Distribute(name string, s *Snapshot)
Distribute is an implementation of SetSnapshot
type Snapshot struct {
// contains filtered or unexported fields
}
Snapshot is an implementation of MCP's snapshot.Snapshot interface. It also exposes additional query methods for analysis purposes.
Collections implements snapshotImpl.Snapshot
Find the resource with the given name and collection.
func (s *Snapshot) ForEach(col collection.Name, fn analysis.IteratorFn)
ForEach iterates all resources in a given collection.
Resources implements snapshotImpl.Snapshot
String implements io.Stringer
Version implements snapshotImpl.Snapshot
type SnapshotOptions struct { Distributor Distributor // The group name for the snapshotImpl. Group string // The publishing strategy for the snapshotImpl. Strategy strategy.Instance // The set of collections to Snapshot. Collections []collection.Name }
SnapshotOptions is settings for a single snapshotImpl target.
type Snapshotter struct {
// contains filtered or unexported fields
}
Snapshotter is a processor that handles input events and creates snapshotImpl collections.
func NewSnapshotter(xforms []event.Transformer, settings []SnapshotOptions) (*Snapshotter, error)
NewSnapshotter returns a new Snapshotter.
func (s *Snapshotter) Handle(e event.Event)
Handle implements Processor
func (s *Snapshotter) Start()
Start implements Processor
func (s *Snapshotter) Stop()
Stop implements Processor
StatusUpdater updates resource statuses, based on the given diagnostic messages.
Path | Synopsis |
---|---|
strategy |
Package snapshotter imports 19 packages (graph) and is imported by 7 packages. Updated 2020-11-14. Refresh now. Tools for package owners.