Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnnotateDiffReports ¶
func AnnotateDiffReports(r []DiffReport, prefix string)
AnnotateDiffReports annotates every DiffReport with a prefix
func SplitGroupVersionSafe ¶
SplitGroupVersionSafe is a helper to ensure that the sorting is done by group first. Fallback in error case: group: "" version: groupversion
Types ¶
type Configuration ¶
Configuration defines the scanning configuration used
type DiffReport ¶
DiffReport defines the type for a single diffing result where A is the old and B is the new value of Element
func Diff ¶
func Diff(a, b []Keyer) []DiffReport
Diff creates a difference report betweed a and b. It assumes that the elements in a and b are sorted by Key()
func DiffReports ¶
func DiffReports(a Report, b Report) []DiffReport
DiffReports creates a DiffReport between a and b. Resources and ResourceObjects from a and b must be sorted
func (DiffReport) String ¶
func (r DiffReport) String() string
type Keyer ¶
type Keyer interface { Key() string Compare(b interface{}) []DiffReport }
Keyer defines an interface which can uniquely identify and compare types together in order to diff them
type Report ¶
type Report struct { ScanStart time.Time ScanEnd time.Time Server Server Resources []Resource ResourceObjects []ResourceObject Configuration Configuration }
Report defines a cluster snapshot
type Resource ¶
Resource defines a kubernetes api resource
func (Resource) Compare ¶
func (a Resource) Compare(b interface{}) []DiffReport
Compare compares two Resources, while b must be a Resource or else it will panic
type ResourceObject ¶
type ResourceObject struct { GroupVersion string Resource string // references Resource.Name Namespace string Name string }
ResourceObject represent a persistent entity in the system
func (ResourceObject) Compare ¶
func (a ResourceObject) Compare(b interface{}) []DiffReport
Compare compares two ResourceObjects, while b must be a ResourceObject or else it will panic
func (ResourceObject) Key ¶
func (a ResourceObject) Key() string
Key returns a unique identifier for the ResourceObject which can be used for sorting
type ResourceObjectSort ¶
type ResourceObjectSort []ResourceObject
ResourceObjectSort implements sorting for ResourceObjects by Key()
func (ResourceObjectSort) Len ¶
func (r ResourceObjectSort) Len() int
func (ResourceObjectSort) Less ¶
func (r ResourceObjectSort) Less(i, j int) bool
func (ResourceObjectSort) Swap ¶
func (r ResourceObjectSort) Swap(i, j int)
type ResourceSort ¶
type ResourceSort []Resource
ResourceSort implements sorting for Resources by Key()
func (ResourceSort) Len ¶
func (r ResourceSort) Len() int
func (ResourceSort) Less ¶
func (r ResourceSort) Less(i, j int) bool
func (ResourceSort) Swap ¶
func (r ResourceSort) Swap(i, j int)