kubernetes

package
v0.0.0-...-140d8b8 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ClusterScopedResources = map[string]bool{}
)

Functions

func BounceMarshalGeneric

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

func ParseMany

func ParseMany(data []byte) ([]interface{}, error)

func ParseManyFromFile

func ParseManyFromFile(path string) ([]interface{}, error)

func Run

func Run(path string)

func RunAnalyzeExample

func RunAnalyzeExample(path string)

Types

type Container

type Container struct {
	IsInit     bool
	Name       string
	ConfigMaps map[string]bool
	Secrets    map[string]bool
	Image      string
}

func (*Container) ConfigMapsSlice

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

func (*Container) SecretsSlice

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

type KeySetComparison

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

func CompareKeySets

func CompareKeySets(a map[string]bool, b map[string]bool) *KeySetComparison

type KubeResources

type KubeResources struct {
	// Order: kind, name
	ClusterScoped map[string]map[string]*Node
	// Order: kind, namespace, name
	Namespaced map[string]map[string]map[string]*Node
}

func ParseResources

func ParseResources(values []interface{}) (*KubeResources, error)

func (*KubeResources) Add

func (k *KubeResources) Add(node *Node) error

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 (*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) ConfigMapUsages

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

func (*Model) ConfigMapsTable

func (m *Model) ConfigMapsTable()

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()

func (*Model) PodsTable

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

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()

func (*Model) SkippedResourcesTable

func (m *Model) SkippedResourcesTable()

func (*Model) Tables

func (m *Model) Tables()

type Node

type Node struct {
	Kind       string
	Namespace  *string
	Name       string
	References []*Node
}

func NewNode

func NewNode(kind string, namespace string, name string) *Node

func (*Node) IsClusterScoped

func (n *Node) IsClusterScoped() bool

func (*Node) ResolvedNamespace

func (n *Node) ResolvedNamespace() 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

Jump to

Keyboard shortcuts

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