matcher

package
v0.0.0-...-7183293 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ImageMatchers = []Matcher{
	{"CronJob", specJobTemplateSpec},
	{"Pod", specPodSpec},
	{"Deployment", specPodTemplateSpec},
	{"DaemonSet", specPodTemplateSpec},
	{"Job", specPodTemplateSpec},
	{"ReplicaSet", specPodTemplateSpec},
	{"ReplicationController", specPodTemplateSpec},
	{"StatefulSet", specPodTemplateSpec},
}
View Source
var ResourceMatchers = []Matcher{
	{"CronJob", resourceJobTemplateSpec},
	{"Pod", resourcePodSpec},
	{"Deployment", resourcePodTemplateSpec},
	{"DaemonSet", resourcePodTemplateSpec},
	{"Job", resourcePodTemplateSpec},
	{"ReplicaSet", resourcePodTemplateSpec},
	{"ReplicationController", resourcePodTemplateSpec},
	{"StatefulSet", resourcePodTemplateSpec},
}

Functions

This section is empty.

Types

type Conf

type Conf struct {
	Memory string `json:"memory,omitempty"`
	CPU    string `json:"cpu,omitempty"`
}

type ContainerResource

type ContainerResource struct {
	Limits   Conf `json:"limits"`
	Requests Conf `json:"requests"`
}

type ContainerResourceResult

type ContainerResourceResult struct {
	ParentName string            `json:"parentName"`
	ParentType string            `json:"parentType"`
	Name       string            `json:"name"`
	Resource   ContainerResource `json:"resources,omitempty"`
}

type ContainerResources

type ContainerResources []ContainerResourceResult

type Images

type Images []string

func (Images) Unique

func (i Images) Unique() Images

type Match

type Match struct {
	Resource *yaml.RNode
	Node     *yaml.RNode
	Value    string
}

type Matcher

type Matcher struct {
	// contains filtered or unexported fields
}

type Matches

type Matches []Match

type Svc

type Svc struct {
	// contains filtered or unexported fields
}

func NewSvc

func NewSvc(fs afero.Fs, wd string, log *logrus.Logger) *Svc

func (Svc) ContainerResources

func (m Svc) ContainerResources(filePath string) (ContainerResources, error)

ContainerResources lists resources configuration in the manifest at filePath

func (Svc) Images

func (m Svc) Images(filePath string) ([]string, error)

func (Svc) Match

func (m Svc) Match(filePath string, matchers []Matcher) (Matches, error)

Match resources with configured paths

Jump to

Keyboard shortcuts

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