k8s

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config *config.Config) source.Source

Types

type Container

type Container struct {
	Name     string `json:"name"`
	Image    string `json:"image"`
	ImageTag string `json:"imageTag"`
}

func (*Container) Children

func (n *Container) Children() []source.ListItem

func (*Container) FilterValue

func (n *Container) FilterValue() string

func (*Container) String

func (n *Container) String() string

type Namespace

type Namespace struct {
	Name      string      `json:"name"`
	Workloads []*Workload `json:"workloads"`
}

func NewNamespace

func NewNamespace(name string, clientset *kubernetes.Clientset) *Namespace

func (*Namespace) Children

func (n *Namespace) Children() []source.ListItem

func (*Namespace) FilterValue

func (n *Namespace) FilterValue() string

func (*Namespace) String

func (n *Namespace) String() string

type Pod

type Pod struct {
	Name              string            `json:"name"`
	UID               string            `json:"uid"`
	Labels            map[string]string `json:"-"`
	CreationTimestamp time.Time         `json:"creationTimestamp"`
	Namespace         string            `json:"namespace"`
	Status            string            `json:"status"`
	Containers        []*Container      `json:"containers"`
}

func GetPodsForWorkload

func GetPodsForWorkload(replicaSets []appsv1.ReplicaSet, workload metav1.Object, namespacedPods []v1.Pod, workloadKind string) []*Pod

GetPodsForWorkload finds and returns a list of pods associated with a given workload. The workload can be either a Deployment or a StatefulSet.

Parameters: - replicaSets: A slice of ReplicaSet objects in the namespace. - workload: The specific workload object (Deployment or StatefulSet). - namespacedPods: A slice of Pod objects in the namespace. - workloadKind: A string indicating the type of the workload ("Deployment" or "StatefulSet").

Returns: - A slice of Pod objects that are associated with the given workload.

func NewPod

func NewPod(pod v1.Pod) *Pod

func (*Pod) Children

func (n *Pod) Children() []source.ListItem

func (*Pod) FilterValue

func (n *Pod) FilterValue() string

func (*Pod) String

func (n *Pod) String() string

type Source

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

func (*Source) Close

func (s *Source) Close()

func (*Source) Columns

func (s *Source) Columns() []*source.List

func (*Source) Init

func (s *Source) Init(stateChan chan state.State) tea.Cmd

func (*Source) Logs

func (s *Source) Logs(ctx context.Context, stateChan chan state.State, logChan chan string) tea.Cmd

type Workload

type Workload struct {
	Kind              string            `json:"kind"`
	Name              string            `json:"name"`
	UID               string            `json:"uid"`
	Labels            map[string]string `json:"-"`
	CreationTimestamp time.Time         `json:"creationTimestamp"`
	Namespace         string            `json:"namespace"`
	Pods              []*Pod            `json:"pods"`
}

func (*Workload) Children

func (n *Workload) Children() []source.ListItem

func (*Workload) FilterValue

func (n *Workload) FilterValue() string

func (*Workload) String

func (n *Workload) String() string

Jump to

Keyboard shortcuts

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