Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImportMultiDocYAML ¶
ImportMultiDocYAML is a helper function that goes through a yaml file with multiple documents (or objects) separated by '---' or '...' and returns an array of yamls.
Types ¶
type ControlRel ¶
ControlRel describes the relationship between a controller and its children pod.
type LabelRel ¶
type LabelRel struct {
Relation
}
LabelRel connects objects with spec.selector with pods that have corresponding metadata.labels.
type MatchExpression ¶
type MatchExpression struct {
// contains filtered or unexported fields
}
MatchExpression is used to match Set-based label selectors.
type MatchLabel ¶
type MatchLabel struct {
// contains filtered or unexported fields
}
MatchLabel is used to match Equality label selector.
type Object ¶
type Object struct { ID int Kind string Name string Namespace string RawYAML map[string]interface{} Relations Relations }
Object contains information about each k8s component in the chart.
func ParseControllers ¶
ParseControllers parses a k8s object from a single-document yaml and returns an array of controllers.
type ParsedObjs ¶
ParsedObjs has methods GetControlRel and GetLabelRel that updates its objects array.
func (*ParsedObjs) GetControlRel ¶
func (parsed *ParsedObjs) GetControlRel()
GetControlRel generates relationships and children objects for common k8s controller types. Note that this only includes controllers whose children are 1) pods and 2) do not have its own YAML. i.e. Children relies entirely on the parent's template. Controllers like CronJob are excluded because its children are not pods.
func (*ParsedObjs) GetLabelRel ¶
func (parsed *ParsedObjs) GetLabelRel()
GetLabelRel is generates relationships between objects connected by selector-label. It supports both Equality-based and Set-based operators with MatchLabels and MatchExpressions, respectively.
func (*ParsedObjs) GetSpecRel ¶
func (parsed *ParsedObjs) GetSpecRel()
GetSpecRel draws relationships between two objects that are tied via various fields in their spec.
type Relation ¶
Relation describes the relationship between k8s components. Type is one of CostrolRel, LabelRel, AnnotationsRel, SpecRel. Source and Target contains the ID of the k8s component that is either the giver or recipient of a relationship. All relations are bi-directional in that each object contains both the incoming and outbound relationships.
type Relations ¶
type Relations struct { ControlRels []ControlRel LabelRels []LabelRel SpecRels []SpecRel }
Relations is embedded into the Object struct and contains arrays of the three types of relationships.