kube

package
v2.2.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BDPodAnnotationKeys

func BDPodAnnotationKeys(containerCount int) []string

BDPodAnnotationKeys .....

func BDPodLabelKeys

func BDPodLabelKeys(containerCount int) []string

BDPodLabelKeys .....

func CopyMap

func CopyMap(dict map[string]string) map[string]string

CopyMap .....

func HasAllKeys

func HasAllKeys(dict map[string]string, keys []string) bool

HasAllKeys .....

func HasAnyKeys

func HasAnyKeys(dict map[string]string, keys []string) bool

HasAnyKeys .....

func ParseImageIDString

func ParseImageIDString(imageID string) (string, string, error)

ParseImageIDString parses an ImageID pulled from kubernetes. Example image id:

docker-pullable://registry.kipp.blackducksoftware.com/blackducksoftware/hub-registration@sha256:cb4983d8399a59bb5ee6e68b6177d878966a8fe41abe18a45c3b1d8809f1d043

func RemoveBDPodAnnotationKeys

func RemoveBDPodAnnotationKeys(containerCount int, annotations map[string]string) map[string]string

RemoveBDPodAnnotationKeys .....

func RemoveBDPodLabelKeys

func RemoveBDPodLabelKeys(containerCount int, labels map[string]string) map[string]string

RemoveBDPodLabelKeys .....

func RemoveKeys

func RemoveKeys(dict map[string]string, keys []string) map[string]string

RemoveKeys .....

Types

type ClientInterface

type ClientInterface interface {
	Dump() (*Dump, error)
}

ClientInterface .....

type Container

type Container struct {
	Image *Image
	Name  string
}

Container .....

func NewContainer

func NewContainer(image *Image, name string) *Container

NewContainer .....

type Dump

type Dump struct {
	Meta              *Meta
	Pods              []*Pod
	PodsByName        map[string]*Pod
	DuplicatePodNames map[string]bool
	// Images     []*Image
	ImagesBySha        map[string]*Image
	DuplicateImageShas map[string]bool
	ImagesMissingSha   []*Image
}

Dump .....

func NewDump

func NewDump(meta *Meta, pods []*Pod) *Dump

NewDump .....

type Image

type Image struct {
	Image   string
	ImageID string
}

Image .....

func NewImage

func NewImage(image string, imageID string) *Image

NewImage .....

func (*Image) ParseImageID

func (image *Image) ParseImageID() (name string, sha string, err error)

ParseImageID .....

type KubeClient

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

KubeClient is an implementation of the Client interface for kubernetes

func NewKubeClient

func NewKubeClient(config *KubeClientConfig) (*KubeClient, error)

NewKubeClient .....

func NewKubeClientFromInsideCluster

func NewKubeClientFromInsideCluster() (*KubeClient, error)

NewKubeClientFromInsideCluster instantiates a KubeClient using configuration pulled from the cluster.

func NewKubeClientFromOutsideCluster

func NewKubeClientFromOutsideCluster(masterURL string, kubeconfigPath string) (*KubeClient, error)

NewKubeClientFromOutsideCluster instantiates a KubeClient using a master URL and a path to a kubeconfig file.

func (*KubeClient) CleanupAllPods

func (client *KubeClient) CleanupAllPods() error

CleanupAllPods .....

func (*KubeClient) Dump

func (client *KubeClient) Dump() (*Dump, error)

Dump .....

func (*KubeClient) GetAllPods

func (client *KubeClient) GetAllPods() ([]*Pod, error)

GetAllPods .....

func (*KubeClient) GetMeta

func (client *KubeClient) GetMeta() (*Meta, error)

GetMeta .....

type KubeClientConfig

type KubeClientConfig struct {
	MasterURL      string
	KubeConfigPath string
}

KubeClientConfig .....

type Meta

type Meta struct {
	MajorVersion string
	MinorVersion string
	GitVersion   string
	GitCommit    string
	GitTreeState string
	BuildDate    string
	GoVersion    string
	Compiler     string
	Platform     string
	NodeCount    int
}

Meta .....

type Pod

type Pod struct {
	Name        string
	UID         string
	Namespace   string
	Containers  []*Container
	Annotations map[string]string
	Labels      map[string]string
}

Pod .....

func NewPod

func NewPod(name string, uid string, namespace string, containers []*Container) *Pod

NewPod .....

func (*Pod) BDAnnotations

func (pod *Pod) BDAnnotations() map[string]string

BDAnnotations .....

func (*Pod) BDLabels

func (pod *Pod) BDLabels() map[string]string

BDLabels .....

func (*Pod) HasAllBDAnnotations

func (pod *Pod) HasAllBDAnnotations() bool

HasAllBDAnnotations .....

func (*Pod) HasAllBDLabels

func (pod *Pod) HasAllBDLabels() bool

HasAllBDLabels .....

func (*Pod) HasAnyBDAnnotations

func (pod *Pod) HasAnyBDAnnotations() bool

HasAnyBDAnnotations .....

func (*Pod) HasAnyBDLabels

func (pod *Pod) HasAnyBDLabels() bool

HasAnyBDLabels .....

func (*Pod) QualifiedName

func (pod *Pod) QualifiedName() string

QualifiedName .....

type PodAnnotationKey

type PodAnnotationKey int

PodAnnotationKey .....

const (
	PodAnnotationKeyVulnerabilities  PodAnnotationKey = iota
	PodAnnotationKeyPolicyViolations PodAnnotationKey = iota
	PodAnnotationKeyOverallStatus    PodAnnotationKey = iota
	PodAnnotationKeyServerVersion    PodAnnotationKey = iota
	PodAnnotationKeyScannerVersion   PodAnnotationKey = iota
)

func (PodAnnotationKey) String

func (pak PodAnnotationKey) String() string

String .....

type PodImageAnnotationKey

type PodImageAnnotationKey int

PodImageAnnotationKey .....

const (
	PodImageAnnotationKeyVulnerabilities  PodImageAnnotationKey = iota
	PodImageAnnotationKeyPolicyViolations PodImageAnnotationKey = iota
	PodImageAnnotationKeyOverallStatus    PodImageAnnotationKey = iota
	PodImageAnnotationKeyServerVersion    PodImageAnnotationKey = iota
	PodImageAnnotationKeyScannerVersion   PodImageAnnotationKey = iota
	PodImageAnnotationKeyProjectEndpoint  PodImageAnnotationKey = iota
	PodImageAnnotationKeyImage            PodImageAnnotationKey = iota
)

func (PodImageAnnotationKey) String

func (pak PodImageAnnotationKey) String(index int) string

String .....

type PodImageLabelKey

type PodImageLabelKey int

PodImageLabelKey .....

const (
	PodImageLabelKeyVulnerabilities  PodImageLabelKey = iota
	PodImageLabelKeyPolicyViolations PodImageLabelKey = iota
	PodImageLabelKeyOverallStatus    PodImageLabelKey = iota
	PodImageLabelKeyImage            PodImageLabelKey = iota
)

func (PodImageLabelKey) String

func (pak PodImageLabelKey) String(index int) string

String .....

type PodLabelKey

type PodLabelKey int

PodLabelKey .....

const (
	PodLabelKeyVulnerabilities  PodLabelKey = iota
	PodLabelKeyPolicyViolations PodLabelKey = iota
	PodLabelKeyOverallStatus    PodLabelKey = iota
)

func (PodLabelKey) String

func (pak PodLabelKey) String() string

String .....

Jump to

Keyboard shortcuts

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