istio: Index | Files | Directories

package snapshotter

import ""


Package Files

analyzingdistributor.go distributor.go snapshot.go snapshotoptions.go snapshotter.go statusupdater.go

type AnalysisSuppression Uses

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 Uses

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 Uses

func NewAnalyzingDistributor(s AnalyzingDistributorSettings) *AnalyzingDistributor

NewAnalyzingDistributor returns a new instance of AnalyzingDistributor.

func (*AnalyzingDistributor) Distribute Uses

func (d *AnalyzingDistributor) Distribute(name string, s *Snapshot)

Distribute implements snapshotter.Distributor

type AnalyzingDistributorSettings Uses

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( 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 Uses

type CollectionReporterFn func(collection.Name)

CollectionReporterFn is a hook function called whenever a collection is accessed through the AnalyzingDistributor's context

type Distributor Uses

type Distributor interface {
    Distribute(name string, s *Snapshot)

Distributor interface abstracts the snapshotImpl distribution mechanism. Typically, this is implemented by the MCP layer.

type InMemoryDistributor Uses

type InMemoryDistributor struct {
    // contains filtered or unexported fields

InMemoryDistributor is an in-memory Distributor implementation.

func NewInMemoryDistributor Uses

func NewInMemoryDistributor() *InMemoryDistributor

NewInMemoryDistributor returns a new instance of InMemoryDistributor

func (*InMemoryDistributor) Distribute Uses

func (d *InMemoryDistributor) Distribute(name string, s *Snapshot)

Distribute is an implementation of Distributor.Distribute

func (*InMemoryDistributor) GetSnapshot Uses

func (d *InMemoryDistributor) GetSnapshot(name string) snapshot.Snapshot

GetSnapshot get the snapshotImpl of the specified name

func (*InMemoryDistributor) NumSnapshots Uses

func (d *InMemoryDistributor) NumSnapshots() int

NumSnapshots returns the current number of snapshots.

type InMemoryStatusUpdater Uses

type InMemoryStatusUpdater struct {
    WaitTimeout time.Duration
    // contains filtered or unexported fields

InMemoryStatusUpdater is an in-memory implementation of StatusUpdater

func (*InMemoryStatusUpdater) Get Uses

func (u *InMemoryStatusUpdater) Get() diag.Messages

Get returns the current set of captured diag.Messages

func (*InMemoryStatusUpdater) Update Uses

func (u *InMemoryStatusUpdater) Update(m diag.Messages)

Update implements StatusUpdater

func (*InMemoryStatusUpdater) WaitForReport Uses

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 Uses

type MCPDistributor struct {
    // contains filtered or unexported fields

MCPDistributor distributes a snapshot to the MCP layer.

func NewMCPDistributor Uses

func NewMCPDistributor(c *snapshot.Cache) *MCPDistributor

NewMCPDistributor returns a new instance of MCPDistributor

func (*MCPDistributor) Distribute Uses

func (d *MCPDistributor) Distribute(name string, s *Snapshot)

Distribute is an implementation of SetSnapshot

type Snapshot Uses

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.

func (*Snapshot) Collections Uses

func (s *Snapshot) Collections() []string

Collections implements snapshotImpl.Snapshot

func (*Snapshot) Find Uses

func (s *Snapshot) Find(cpl collection.Name, name resource.FullName) *resource.Instance

Find the resource with the given name and collection.

func (*Snapshot) ForEach Uses

func (s *Snapshot) ForEach(col collection.Name, fn analysis.IteratorFn)

ForEach iterates all resources in a given collection.

func (*Snapshot) Resources Uses

func (s *Snapshot) Resources(col string) []*mcp.Resource

Resources implements snapshotImpl.Snapshot

func (*Snapshot) String Uses

func (s *Snapshot) String() string

String implements io.Stringer

func (*Snapshot) Version Uses

func (s *Snapshot) Version(col string) string

Version implements snapshotImpl.Snapshot

type SnapshotOptions Uses

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 Uses

type Snapshotter struct {
    // contains filtered or unexported fields

Snapshotter is a processor that handles input events and creates snapshotImpl collections.

func NewSnapshotter Uses

func NewSnapshotter(xforms []event.Transformer, settings []SnapshotOptions) (*Snapshotter, error)

NewSnapshotter returns a new Snapshotter.

func (*Snapshotter) Handle Uses

func (s *Snapshotter) Handle(e event.Event)

Handle implements Processor

func (*Snapshotter) Start Uses

func (s *Snapshotter) Start()

Start implements Processor

func (*Snapshotter) Stop Uses

func (s *Snapshotter) Stop()

Stop implements Processor

type StatusUpdater Uses

type StatusUpdater interface {
    Update(messages diag.Messages)

StatusUpdater updates resource statuses, based on the given diagnostic messages.



Package snapshotter imports 19 packages (graph) and is imported by 7 packages. Updated 2020-11-14. Refresh now. Tools for package owners.