webhook

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WebhookName    = "CosignWebhook"
	WebhookEnable  = "enabled"
	WebhookDisable = "disabled"
	WebhookVersion = "v1"
)

Variables

View Source
var (
	ErrInvalidCosignCRDMoreThanOne = errors.New("invalid cosignkey CRD more than one in this namespace")
	ErrInvalidAdmissionReview      = errors.New("invalid admission review error")
	ErrInvalidAdmissionReviewObj   = errors.New("invalid admission review object error")
	ErrMissingCosignCRD            = errors.New("invalid cosignkey CRD not find in cluster")
	ErrMissingCosignCRDKeys        = errors.New("invalid cosignkey CRD key counter iz zero in cluster")
	ErrInvalidCosignVerify         = errors.New("invalid cosign verify cosignkey key error")
)
View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "kubeservice.cn", Version: "v1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func NewPodAnnotatorMutate

func NewPodAnnotatorMutate(c client.Client, d *admission.Decoder) admission.Handler

Types

type Authorities

type Authorities struct {
	Key []string `json:"key"`
}

func (*Authorities) DeepCopy

func (in *Authorities) DeepCopy() *Authorities

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Authorities.

func (*Authorities) DeepCopyInto

func (in *Authorities) DeepCopyInto(out *Authorities)

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

type CosignKey

type CosignKey struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   CosignKeySpec   `json:"spec,omitempty"`
	Status CosignKeyStatus `json:"status,omitempty"`
}

CosignKey is the Schema for the cosignkeys API

func (*CosignKey) DeepCopy

func (in *CosignKey) DeepCopy() *CosignKey

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CosignKey.

func (*CosignKey) DeepCopyInto

func (in *CosignKey) DeepCopyInto(out *CosignKey)

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

func (*CosignKey) DeepCopyObject

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

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

type CosignKeyList

type CosignKeyList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []CosignKey `json:"items"`
}

CosignKeyList contains a list of CosignKey

func (*CosignKeyList) DeepCopy

func (in *CosignKeyList) DeepCopy() *CosignKeyList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CosignKeyList.

func (*CosignKeyList) DeepCopyInto

func (in *CosignKeyList) DeepCopyInto(out *CosignKeyList)

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

func (*CosignKeyList) DeepCopyObject

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

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

type CosignKeySpec

type CosignKeySpec struct {

	// Foo is an example field of CosignKey. Edit CosignKey_types.go to remove/update
	Auth Authorities `json:"authorities"`
}

CosignKeySpec defines the desired state of CosignKey

func (*CosignKeySpec) DeepCopy

func (in *CosignKeySpec) DeepCopy() *CosignKeySpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CosignKeySpec.

func (*CosignKeySpec) DeepCopyInto

func (in *CosignKeySpec) DeepCopyInto(out *CosignKeySpec)

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

type CosignKeyStatus

type CosignKeyStatus struct {
}

CosignKeyStatus defines the observed state of CosignKey

func (*CosignKeyStatus) DeepCopy

func (in *CosignKeyStatus) DeepCopy() *CosignKeyStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CosignKeyStatus.

func (*CosignKeyStatus) DeepCopyInto

func (in *CosignKeyStatus) DeepCopyInto(out *CosignKeyStatus)

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

type CustomCosignKey

type CustomCosignKey struct {
	Client client.Reader
}

func (*CustomCosignKey) Default

func (r *CustomCosignKey) Default(ctx context.Context, obj runtime.Object) error

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*CustomCosignKey) SetupWebhookWithManager

func (r *CustomCosignKey) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*CustomCosignKey) ValidateCreate

func (r *CustomCosignKey) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*CustomCosignKey) ValidateDelete

func (r *CustomCosignKey) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*CustomCosignKey) ValidateUpdate

func (r *CustomCosignKey) ValidateUpdate(ctx context.Context, oldObj runtime.Object, newObj runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type PodAnnotator

type PodAnnotator struct {
	Client client.Client
	// contains filtered or unexported fields
}

PodAnnotator validates Pods

func (*PodAnnotator) GeCosignKeys added in v1.1.0

func (a *PodAnnotator) GeCosignKeys(namespace string) ([]CosignKey, error)

func (*PodAnnotator) Handle

PodAnnotator adds an annotation to every incoming pods.

func (*PodAnnotator) ValidationCosignVerify

func (a *PodAnnotator) ValidationCosignVerify(items []CosignKey, image string) (bool, error)

Jump to

Keyboard shortcuts

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