Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Extractor ¶
type Extractor struct {
// contains filtered or unexported fields
}
Extractor implements extractor from admission request to workload resource.
func NewExtractor ¶
func NewExtractor(instrumentationProvider instrumentation.IInstrumentationProvider, configuration *ExtractorConfiguration) *Extractor
NewExtractor Constructor for Extractor
func (*Extractor) ExtractWorkloadResourceFromAdmissionRequest ¶
func (extractor *Extractor) ExtractWorkloadResourceFromAdmissionRequest(req *admission.Request) (resource *WorkloadResource, err error)
ExtractWorkloadResourceFromAdmissionRequest return WorkloadResource object according to the information in admission.Request.
type ExtractorConfiguration ¶
type ExtractorConfiguration struct {
SupportedKubernetesWorkloadResources []string
}
ExtractorConfiguration configuration for extractor
type IExtractor ¶
type IExtractor interface {
// ExtractWorkloadResourceFromAdmissionRequest return WorkloadResource object according
// to the information in admission.Request.
ExtractWorkloadResourceFromAdmissionRequest(req *admission.Request) (*WorkloadResource, error)
}
IExtractor represents interface for admission request extractor.
type ObjectMetadata ¶
type ObjectMetadata struct {
// Name is the resource's name.
Name string
// Namespace defines the space within which each name must be unique. An empty namespace is
// equivalent to the "default" namespace, but "default" is the canonical representation.
// Not all objects are required to be scoped to a namespace - the value of this field for
// those objects will be empty.
Namespace string
// Annotations is an unstructured key value map stored with a resource that may be
// set by external tools to store and retrieve arbitrary metadata. They are not
// queryable and should be preserved when modifying objects.
Annotations map[string]string
// List of objects depended by this object. If ALL objects in the list have
// been deleted, this object will be garbage collected. If this object is managed by a controller,
// then an entry in this list will point to this controller, with the controller field set to true.
// There cannot be more than one managing controller.
OwnerReferences []*OwnerReference
}
ObjectMetadata represents the metadata of WorkloadResource object.
type OwnerReference ¶
type OwnerReference struct {
// API version of the referent.
APIVersion string
// Kind of the referent.
Kind string
// Name of the referent.
Name string
}
OwnerReference contains information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.
type PodSpec ¶
type PodSpec struct {
// Containers is a list of Container objects.
Containers []*Container
// InitContainers is a list of Container objects.
InitContainers []*Container
// ImagePullSecrets is an optional list of references to secrets in the same namespace to use for pulling any of the images used by this PodSpec.
// If specified, these secrets will be passed to individual puller implementations for them to use. For example,
// in the case of docker, only DockerConfig type secrets are honored.
ImagePullSecrets []*corev1.LocalObjectReference
// ServiceAccountName is the name of the ServiceAccount to use to run this WorkloadResource
// The WorkloadResource will be allowed to use secrets referenced by the ServiceAccount
ServiceAccountName string
}
PodSpec represents a specification of the desired behavior of the WorkloadResource.
func (*PodSpec) ExtractContainersFromPodSpecAsString ¶
ExtractContainersFromPodSpecAsString gets pod spec and returns all containers as containerName:image used by the pod as String. For example appContainer:alpine
type WorkloadResource ¶
type WorkloadResource struct {
// WorkloadResource metadata
Metadata *ObjectMetadata
// Spec defines the behavior of a WorkloadResource.
Spec *PodSpec
}
WorkloadResource represents an abstraction of a kubernetes workload resources such as: Pod, Deployments, ReplicaSet, StatefulSets, DaemonSet, Jobs, CronJob and ReplicationController.