kubernetes

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseObjectIntoType added in v0.0.5

func ParseObjectIntoType[A any](in interface{}) (*A, error)

ParseObjectIntoType takes a weakly typed object -- such as an interface{}, a

map[string]interface{}, etc. -- marshals it into yaml, then unmarshals it
back into a strongly typed object -- such as a batchv1.Job
The goal is to convert a weakly typed object into a strongly typed one;
the yaml intermediary is just a convenient implementation detail.

func RunYamlAnalysis added in v0.0.4

func RunYamlAnalysis(args *YamlAnalysisArgs)

Types

type Container

type Container struct {
	IsInit     bool
	Name       string
	ConfigMaps *set.Set[string]
	Secrets    *set.Set[string]
	Image      string
}

func (*Container) ConfigMapsSlice

func (c *Container) ConfigMapsSlice() []string

func (*Container) SecretsSlice

func (c *Container) SecretsSlice() []string

type KeySetComparison

type KeySetComparison struct {
	JustA []string
	Both  []string
	JustB []string
}

func CompareKeySets

func CompareKeySets(a *set.Set[string], b *set.Set[string]) *KeySetComparison

type Model

type Model struct {
	Pods       map[string]map[string]*PodSpec
	Secrets    []string
	ConfigMaps []string
	Skipped    map[string][]string
}

func NewModel

func NewModel() *Model

func NewModelFromYaml added in v0.0.5

func NewModelFromYaml(objs []map[string]interface{}) *Model

func (*Model) AddPodWrapper

func (m *Model) AddPodWrapper(kind string, name string, spec *PodSpec)

func (*Model) AddSkippedResource

func (m *Model) AddSkippedResource(kind string, name string)

func (*Model) BuildTables added in v0.0.4

func (m *Model) BuildTables() (string, string, string, string, map[string]string)

func (*Model) ConfigMapUsages

func (m *Model) ConfigMapUsages(name string) []string

func (*Model) ConfigMapsTable

func (m *Model) ConfigMapsTable() string

func (*Model) GetImageUsages

func (m *Model) GetImageUsages() map[string][]string

func (*Model) GetUsedUnusedSecretsAndConfigMaps

func (m *Model) GetUsedUnusedSecretsAndConfigMaps() (*KeySetComparison, *KeySetComparison)

func (*Model) Graph

func (m *Model) Graph() *graph.Graph

func (*Model) ImagesTable

func (m *Model) ImagesTable() string

func (*Model) PodsTable

func (m *Model) PodsTable(resources map[string]*PodSpec) string

func (*Model) SecretConfigMapsUsages

func (m *Model) SecretConfigMapsUsages() (map[string][]string, map[string][]string)

func (*Model) SecretUsages

func (m *Model) SecretUsages(name string) []string

func (*Model) SecretsTable

func (m *Model) SecretsTable() string

func (*Model) SkippedResourcesTable

func (m *Model) SkippedResourcesTable() string

type PodSpec

type PodSpec struct {
	Containers       []*Container
	ServiceAccount   string
	ImagePullSecrets []string
}

func AnalyzeCronJob

func AnalyzeCronJob(job *batchv1.CronJob) *PodSpec

func AnalyzeDeployment

func AnalyzeDeployment(dep *appsv1.Deployment) *PodSpec

func AnalyzeJob

func AnalyzeJob(job *batchv1.Job) *PodSpec

func AnalyzePodSpec

func AnalyzePodSpec(spec v1.PodSpec) *PodSpec

func AnalyzeStatefulSet

func AnalyzeStatefulSet(sset *appsv1.StatefulSet) *PodSpec

type YamlAnalysisArgs added in v0.0.4

type YamlAnalysisArgs struct {
	ChartPath    string
	PrintSkipped bool
	Resources    []string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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