inventory

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchNodes

func FetchNodes(c client.Client, batchSize, timeout int64, includeAnnotations, includeLabels []string, disableMetadata bool) (map[string]Node, error)

func FetchPodsInNamespace

func FetchPodsInNamespace(c client.Client, batchSize, timeout int64, namespace string) ([]v1.Pod, error)

Types

type Container

type Container struct {
	ID          string `json:"id"`
	ImageDigest string `json:"image_digest"`
	ImageTag    string `json:"image_tag"`
	Name        string `json:"name"`
	PodUID      string `json:"pod_uid"`
}

func GetContainersFromPods

func GetContainersFromPods(
	pods []v1.Pod,
	ignoreNotRunning bool,
	missingRegistryOverride, missingTagPolicy, dummyTag string,
) []Container

type Namespace

type Namespace struct {
	Annotations map[string]string `json:"annotations,omitempty"`
	Labels      map[string]string `json:"labels,omitempty"`
	Name        string            `json:"name"`
	UID         string            `json:"uid"`
}

func FetchNamespaces

func FetchNamespaces(
	c client.Client,
	batchSize, timeout int64,
	excludes, includes []string,
	includeAnnotations, includeLabels []string,
	disableMetadata bool,
) ([]Namespace, error)

type Node

type Node struct {
	Annotations             map[string]string `json:"annotations,omitempty"`
	Arch                    string            `json:"arch,omitempty"`
	ContainerRuntimeVersion string            `json:"container_runtime_version,omitempty"`
	KernelVersion           string            `json:"kernel_version,omitempty"`
	KubeProxyVersion        string            `json:"kube_proxy_version,omitempty"`
	KubeletVersion          string            `json:"kubelet_version,omitempty"`
	Labels                  map[string]string `json:"labels,omitempty"`
	Name                    string            `json:"name"`
	OperatingSystem         string            `json:"operating_system,omitempty"`
	UID                     string            `json:"uid"`
}

type Pod

type Pod struct {
	Annotations  map[string]string `json:"annotations,omitempty"`
	Labels       map[string]string `json:"labels,omitempty"`
	Name         string            `json:"name"`
	NamespaceUID string            `json:"namespace_uid"`
	NodeUID      string            `json:"node_uid,omitempty"`
	UID          string            `json:"uid"`
}

func ProcessPods

func ProcessPods(pods []v1.Pod, namespaceUID string, nodes map[string]Node, includeAnnotations, includeLabels []string, disableMetadata bool) []Pod

type Report

type Report struct {
	ClusterName           string        `json:"cluster_name"`
	Containers            []Container   `json:"containers"`
	Namespaces            []Namespace   `json:"namespaces,omitempty"`
	Nodes                 []Node        `json:"nodes,omitempty"`
	Pods                  []Pod         `json:"pods,omitempty"`
	ServerVersionMetadata *version.Info `json:"serverVersionMetadata"`
	Timestamp             string        `json:"timestamp,omitempty"` // Should be generated using time.Now.UTC() and formatted according to RFC Y-M-DTH:M:SZ
}

Jump to

Keyboard shortcuts

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