resource

package
v3.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: Apache-2.0 Imports: 21 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
	IngressNetV1Beta1 networkingv1beta1.Ingress
	IngressNetV1      networkingv1.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

func (IngressResource) GetAnnotations added in v3.6.1

func (ir IngressResource) GetAnnotations() map[string]string

GetAnnotations returns ingress annotations, across all available ingress versions

func (IngressResource) GetHosts added in v3.6.1

func (ir IngressResource) GetHosts() []string

GetHosts returns list of all hosts in ingress spec, across all available ingress versions

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 *admissionv1.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

type VirtualService added in v3.5.0

type VirtualService struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	// Spec defines the behavior of a service.
	// https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
	// +optional
	Spec networkingistiov1beta1.VirtualService `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
}

func (*VirtualService) DeepCopy added in v3.5.0

func (in *VirtualService) DeepCopy() *VirtualService

DeepCopy is a deepcopy function, copying the receiver, creating a new Service.

func (*VirtualService) DeepCopyInto added in v3.5.0

func (in *VirtualService) DeepCopyInto(out *VirtualService)

DeepCopyInto is a deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*VirtualService) DeepCopyObject added in v3.5.0

func (in *VirtualService) DeepCopyObject() runtime.Object

DeepCopyObject is a deepcopy function, copying the receiver, creating a new runtime.Object.

type VirtualServiceResource added in v3.5.0

type VirtualServiceResource struct {
	VirtualService VirtualService
	ResourceName   string
	ResourceKind   string
}

ServiceResource contains the information needed for processing by a Policy

func GetVirtualServiceResource added in v3.5.0

func GetVirtualServiceResource(ctx context.Context, ar *admissionv1.AdmissionRequest) *VirtualServiceResource

GetVirtualServiceResource extracts a VirtualServiceResource from an AdmissionRequest

Jump to

Keyboard shortcuts

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