resource

package
v1.5.2-0...-73c76f7 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetResourceCache

func GetResourceCache(ctx context.Context) *cache

GetResourceCache returns the cache from the context. Result will return nil when none exists.

func GetResourceName

func GetResourceName(meta metav1.ObjectMeta) (name string)

GetResourceName attempts to get the best name for a resource

func WithResourceCache

func WithResourceCache(ctx context.Context) context.Context

WithResourceCache adds a resource cache to the context returned.

Types

type ClusterRoleBindingResource

type ClusterRoleBindingResource struct {
	ClusterRoleBinding rbacv1.ClusterRoleBinding
	ResourceName       string
	ResourceKind       string
}

ClusterRoleBindingResource contains the information needed for processing by a Policy

func GetClusterRoleBindingResource

func GetClusterRoleBindingResource(ctx context.Context, ar *admissionv1.AdmissionRequest) *ClusterRoleBindingResource

GetClusterRoleBindingResource extracts a ClusterRoleBindingResource from an AdmissionRequest

type IngressResource

type IngressResource struct {
	IngressExt   extensionsv1beta1.Ingress
	IngressNet   networkingv1beta1.Ingress
	ResourceName string
	ResourceKind string
}

IngressResource contains the information needed for processing by a Policy

func GetIngressResource

func GetIngressResource(ctx context.Context, ar *admissionv1.AdmissionRequest) *IngressResource

GetIngressResource extracts and IngressResource from an AdmissionRequest

type PersistentVolumeResource

type PersistentVolumeResource struct {
	PersistentVolume corev1.PersistentVolume
	ResourceName     string
	ResourceKind     string
}

PersistentVolumeResource contains the information needed for processing by a Policy

func GetPersistentVolumeResource

func GetPersistentVolumeResource(ctx context.Context, ar *admissionv1.AdmissionRequest) *PersistentVolumeResource

GetPersistentVolumeResource extracts and PersistentVolumeResource from an AdmissionRequest

type PodDisruptionBudgetResource

type PodDisruptionBudgetResource struct {
	PodDisruptionBudget policyv1beta1.PodDisruptionBudget
	ResourceName        string
	ResourceKind        string
}

PodDisruptionBudgetResource contains the information needed for processing by a Policy

func GetPodDisruptionBudgetResource

func GetPodDisruptionBudgetResource(ctx context.Context, ar *admissionv1beta1.AdmissionRequest) *PodDisruptionBudgetResource

GetPodDisruptionBudgetResource extracts an PodDisruptionBudgetResource from an AdmissionRequest

type PodExecResource

type PodExecResource struct {
	Command      string
	ResourceName string
	ResourceKind string
}

PodExecResource contains the information needed for processing by a Policy

func GetPodExecResource

func GetPodExecResource(ctx context.Context, ar *admissionv1.AdmissionRequest) *PodExecResource

GetPodExecResource extracts and PodExecResource from an AdmissionRequest

type PodResource

type PodResource struct {
	PodSpec        corev1.PodSpec
	PodAnnotations map[string]string
	ResourceName   string
	ResourceKind   string
}

PodResource contains the information needed for processing by a Policy

func GetPodResource

func GetPodResource(ctx context.Context, ar *admissionv1.AdmissionRequest) *PodResource

GetPodResource extracts a PodResource from an AdmissionRequest

type RoleBindingResource

type RoleBindingResource struct {
	RoleBinding  rbacv1.RoleBinding
	ResourceName string
	ResourceKind string
}

RoleBindingResource contains the information needed for processing by a Policy

func GetRoleBindingResource

func GetRoleBindingResource(ctx context.Context, ar *admissionv1.AdmissionRequest) *RoleBindingResource

GetRoleBindingResource extracts a RoleBindingResource from an AdmissionRequest

type ServiceResource

type ServiceResource struct {
	Service      corev1.Service
	ResourceName string
	ResourceKind string
}

ServiceResource contains the information needed for processing by a Policy

func GetServiceResource

func GetServiceResource(ctx context.Context, ar *admissionv1.AdmissionRequest) *ServiceResource

GetServiceResource extracts and ServiceResource from an AdmissionRequest

Jump to

Keyboard shortcuts

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