kube

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: Apache-2.0 Imports: 24 Imported by: 8

Documentation

Index

Constants

View Source
const (
	// NamespaceStarboard the name of the namespace in which Starboard stores its
	// configuration and runs scan Jobs.
	NamespaceStarboard = "starboard"
	// ServiceAccountStarboard the name of the ServiceAccount used to run scan Jobs.
	ServiceAccountStarboard = "starboard"
	// ConfigMapStarboard the name of the ConfigMap that stored configuration of
	// Starboard and the underlying scanners.
	ConfigMapStarboard = "starboard"
)
View Source
const (
	// TODO I'm wondering if we should rename starboard.resource.* labels to starboard.object.*
	// TODO In Kubernetes API terminology a resource is usually lowercase, plural word (e.g. pods) identifying a set of
	// TODO HTTP endpoints (paths) exposing the CRUD semantics of a certain object type in the system
	LabelResourceKind      = "starboard.resource.kind"
	LabelResourceName      = "starboard.resource.name"
	LabelResourceNamespace = "starboard.resource.namespace"

	LabelContainerName = "starboard.container.name"

	LabelScannerName   = "starboard.scanner.name"
	LabelScannerVendor = "starboard.scanner.vendor"
)
View Source
const (
	AnnotationContainerImages = "starboard.container-images"
)

Variables

This section is empty.

Functions

func GVKForObject

func GVKForObject(obj runtime.Object, scheme *runtime.Scheme) (schema.GroupVersionKind, error)

func GVRForResource

func GVRForResource(mapper meta.RESTMapper, resource string) (gvr schema.GroupVersionResource, gvk schema.GroupVersionKind, err error)

func KindForObject

func KindForObject(object metav1.Object, scheme *runtime.Scheme) (string, error)

func NewRunnableJob

func NewRunnableJob(clientset kubernetes.Interface, spec *batch.Job) runner.Runnable

NewRunnableJob constructs a new Runnable task which runs a Kubernetes Job with the given spec and waits for the completion or failure.

func SetOwnerReference

func SetOwnerReference(owner, object metav1.Object, scheme *runtime.Scheme) error

Types

type CRManager

type CRManager interface {
	Init(ctx context.Context) error
	Cleanup(ctx context.Context) error
}

TODO This is no longer CRManager as we're creating other resources, such as ClusterRoles and ConfigMaps CRManager defined methods for managing Kubernetes custom resources.

func NewCRManager

func NewCRManager(clientset kubernetes.Interface, clientsetext extapi.ApiextensionsV1beta1Interface) CRManager

NewCRManager constructs a CRManager with the given Kubernetes interface.

type ContainerImages

type ContainerImages map[string]string

ContainerImages is a simple structure to hold the mapping between container names and container image references.

func (ContainerImages) AsJSON

func (ci ContainerImages) AsJSON() (string, error)

func (ContainerImages) FromJSON

func (ci ContainerImages) FromJSON(value string) error

type Kind

type Kind string

Kind represents the type of a Kubernetes Object.

const (
	KindUnknown Kind = "Unknown"

	KindNode Kind = "Node"

	KindPod                   Kind = "Pod"
	KindReplicaSet            Kind = "ReplicaSet"
	KindReplicationController Kind = "ReplicationController"
	KindDeployment            Kind = "Deployment"
	KindStatefulSet           Kind = "StatefulSet"
	KindDaemonSet             Kind = "DaemonSet"
	KindCronJob               Kind = "CronJob"
	KindJob                   Kind = "Job"
)

type Object

type Object struct {
	Kind      Kind
	Name      string
	Namespace string
}

Object is a simplified representation of a Kubernetes object. Each object has kind, which designates the type of the entity it represents. Objects have names and many of them live in namespaces.

func ObjectFromLabelsSet

func ObjectFromLabelsSet(set labels.Set) (Object, error)

type ScannerOpts

type ScannerOpts struct {
	ScanJobTimeout time.Duration
	DeleteScanJob  bool
}

ScannerOpts holds configuration of the vulnerability Scanner.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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