api

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImageTag added in v1.0.7

func GetImageTag(imageID string) string

GetImageTag checks if the image has tag suffix, if it does, then it returns it

func NewNodes added in v1.0.5

func NewNodes(nodes []v1.Node) map[string]Node

func ParseImageID added in v1.0.1

func ParseImageID(imageID string) string

ParseImageID checks if passed in imageID is just id, if it is it returns it. If it is not, then it parses image and returns only image ID

Types

type Client

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

func NewClient

func NewClient(kubeconfigPath string) (Client, error)

func (Client) ListRegistries

func (c Client) ListRegistries(namespace string) (Registries, error)

type Container

type Container struct {
	Name           string
	Pod            Pod
	IsInit         bool
	ImageName      ImageName
	ImageSizeBytes int64
	NodeName       string
	NodeCreated    time.Time
	State          string // waiting, running or terminated
	Message        string // reason and message if container is waiting, start time if running, ...
	RestartCount   int
}

func NewContainer

func NewContainer(pod v1.Pod, container v1.Container, isInit bool) Container

type Containers

type Containers []Container

type ID added in v1.0.1

type ID struct {
	Name string
	// contains filtered or unexported fields
}

ID is container image digest/ID, it comes from container status after image is pulled

func (ID) ListContainers added in v1.0.1

func (i ID) ListContainers() []Container

func (ID) ListTags added in v1.0.7

func (i ID) ListTags() []string

type ImageName

type ImageName struct {
	Registry   string
	Repository string
	Tag        string
	ID         string
	Error      string
}

func ParseImageName

func ParseImageName(image string) ImageName

func (ImageName) Equals added in v1.0.5

func (i ImageName) Equals(imageName ImageName) bool

func (ImageName) String added in v1.0.5

func (i ImageName) String() string

type Node added in v1.0.5

type Node struct {
	Name       string
	Created    time.Time
	NodeImages NodeImages
}

func NewNode added in v1.0.5

func NewNode(node v1.Node) Node

type NodeImages added in v1.0.5

type NodeImages []nodeImage

func (NodeImages) GetSizeBytes added in v1.0.5

func (n NodeImages) GetSizeBytes(imageName ImageName) int64

GetSizeBytes return size in bytes if the image is found on this node, 0 is returned otherwise

type Pod

type Pod struct {
	Name      string
	Namespace string
	Phase     string
}

func NewPod

func NewPod(pod v1.Pod) Pod

type Registries

type Registries map[string]Registry

Registries map where key is registry name (e.g. gcr.io) and value is Registry struct

func NewRegistries

func NewRegistries(nodes map[string]Node, pods []v1.Pod) Registries

func (Registries) List

func (r Registries) List() []Registry

type Registry

type Registry struct {
	Name string
	// contains filtered or unexported fields
}

Registry (e.g. gcr.io) 'bucket' of repositories (and images)

func (Registry) ListRepositories

func (r Registry) ListRepositories() []Repository

type Repository

type Repository struct {
	Name string
	IDs  map[string]ID
}

Repository (image name without registry and tag/id e.g. jacksontj/promxy) 'bucket' of tags/ids

func (Repository) ListIDs added in v1.0.7

func (r Repository) ListIDs() []ID

Jump to

Keyboard shortcuts

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