import "istio.io/istio/galley/pkg/config/analysis/local"
analyze.go defaults.go source.go
type AnalysisResult struct { Messages diag.Messages SkippedAnalyzers []string ExecutedAnalyzers []string }
AnalysisResult represents the returnable results of an analysis execution
type ReaderSource struct { // Name is the name of the source (commonly the path to a file, but can be "-" for sources read from stdin or "" if completely synthetic). Name string // Reader is the reader instance to use. Reader io.Reader }
ReaderSource is a tuple of a io.Reader and filepath.
type SourceAnalyzer struct {
// contains filtered or unexported fields
}
SourceAnalyzer handles local analysis of k8s event sources, both live and file-based
func NewSourceAnalyzer(m *schema.Metadata, analyzer *analysis.CombinedAnalyzer, namespace, istioNamespace resource.Namespace, cr snapshotter.CollectionReporterFn, serviceDiscovery bool, timeout time.Duration) *SourceAnalyzer
NewSourceAnalyzer creates a new SourceAnalyzer with no sources. Use the Add*Source methods to add sources in ascending precedence order, then execute Analyze to perform the analysis
func (sa *SourceAnalyzer) AddDefaultResources() error
AddDefaultResources adds some basic dummy Istio resources, based on mesh configuration. This is useful for files-only analysis cases where we don't expect the user to be including istio system resources and don't want to generate false positives because they aren't there. Respect mesh config when deciding which default resources should be generated
func (sa *SourceAnalyzer) AddFileKubeMeshConfig(file string) error
AddFileKubeMeshConfig gets mesh config from the specified yaml file
func (sa *SourceAnalyzer) AddFileKubeMeshNetworks(file string) error
AddFileKubeMeshNetworks gets a file meshnetworks and add it to the analyzer.
func (sa *SourceAnalyzer) AddInMemorySource(src *inmemory.Source)
AddInMemorySource adds a source based on user supplied in-memory configs to the current SourceAnalyzer Assumes that the in memory source has same or subset of resource types that this analyzer is configured with. This can be used by external users who import the analyzer as a module within their own controllers.
func (sa *SourceAnalyzer) AddReaderKubeSource(readers []ReaderSource) error
AddReaderKubeSource adds a source based on the specified k8s yaml files to the current SourceAnalyzer
func (sa *SourceAnalyzer) AddRunningKubeSource(k kube.Interfaces)
AddRunningKubeSource adds a source based on a running k8s cluster to the current SourceAnalyzer Also tries to get mesh config from the running cluster, if it can
func (sa *SourceAnalyzer) Analyze(cancel chan struct{}) (AnalysisResult, error)
Analyze loads the sources and executes the analysis
func (sa *SourceAnalyzer) SetSuppressions(suppressions []snapshotter.AnalysisSuppression)
SetSuppressions will set the list of suppressions for the analyzer. Any resource that matches the provided suppression will not be included in the final message output.
Package local imports 35 packages (graph) and is imported by 3 packages. Updated 2021-01-21. Refresh now. Tools for package owners.