internal

package
v0.0.0-...-f8b040b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CheckStartMsg    string = "starting"
	CheckWriteMsg    string = "writing-result"
	CheckCompleteMsg string = "complete"
)

Functions

func IsSonobouyPod

func IsSonobouyPod(podName string) bool

Types

type Check

type Check interface {
	AddtoRunner(*Runner)
}

Check is a configured check ready to be added to a runner.

type CheckConfig

type CheckConfig struct {
	Name        string            `yaml:"name"`
	Description string            `yaml:"description"`
	Kind        string            `yaml:"kind"`
	Spec        map[string]string `yaml:"spec"`
}

CheckConfig defines a Check.

type Config

type Config struct {
	Cfg ReliabilityConfig `env:"CONFIG"`
}

Config is used to read config back in at runtime.

type Item

type Item struct {
	Name    string                 `yaml:"name"`
	Status  string                 `yaml:"status"`
	Details map[string]interface{} `yaml:"details"`
}

Item defines an Item within a ReportItem

type Querier

type Querier interface {
	Start(*QuerierConfig)
}

Querier is a gather of information that can be ran by the Runner.

type QuerierConfig

type QuerierConfig struct {
	Context  context.Context
	Results  chan ReportItem
	Logger   *log.Logger
	Complete chan struct{}
}

QuerierConfig provides generic configuration options for a Querier

type ReliabilityConfig

type ReliabilityConfig struct {
	Checks []CheckConfig `yaml:"checks"`
}

ReliabilityConfig defines an overall configuration for the Reliability Scanner.

type Report

type Report struct {
	Name   string `yaml:"name"`
	Status string `yaml:"status"`
	Meta   struct {
		Type string `yaml:"type"`
	} `yaml:"meta"`
	Items []ReportItem
}

Report is the overall output of the program to be returned to Sonobuoy

type ReportItem

type ReportItem struct {
	Name   string `yaml:"name"`
	Status string `yaml:"status"`
	Meta   struct {
		File string `yaml:"file"`
		Type string `yaml:"type"`
	} `yaml:"meta"`
	Items []Item `yaml:"items"`
}

ReportItem defines a set of Items

type Runner

type Runner struct {
	Config   *ReliabilityConfig
	Context  context.Context
	Queriers []Querier
	Results  chan ReportItem
	Complete chan struct{}
	Logger   *log.Logger
}

Runner runs the included Queriers, based on the configured Checks provided.

func (*Runner) BuildReport

func (runner *Runner) BuildReport(cc int, name string) *Report

BuildReport given data returns a Report ready for writing

func (Runner) Run

func (runner Runner) Run()

Run runs the Runner

func (*Runner) WriteReport

func (runner *Runner) WriteReport(report *Report, path string) error

WriteReport writes a Report out to a path on disk

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL