reviewer

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(name string, manager manager.Manager, k8s *k8s.Interface, hooks map[schema.GroupVersionResource]Hook)

Types

type AdmissionReviewer

func NewAdmissionReviewer

func NewAdmissionReviewer(hook Hook, k8s *k8s.Interface, logger logr.Logger) *AdmissionReviewer

NewAdmissionReviewer allocate a reviewer for processing requested reviews

func (*AdmissionReviewer) InjectDecoder

func (r *AdmissionReviewer) InjectDecoder(d *admission.Decoder) error

func (*AdmissionReviewer) PerformAdmissionReview

PerformAdmissionReview : It generates the Adminission Review Response

type BaseStage

type BaseStage struct {
	Error error
	ResponseType
	logr.Logger
	*k8s.Interface
}

func (*BaseStage) Allow

func (s *BaseStage) Allow(cause error) *BaseStage

func (*BaseStage) CanContinue

func (s *BaseStage) CanContinue() bool

func (*BaseStage) Fail

func (s *BaseStage) Fail(cause error) *BaseStage

func (*BaseStage) JsonPatch

func (s *BaseStage) JsonPatch() *BaseStage

type EndStage

type EndStage struct {
	*ThenStage
}

func (*EndStage) Response

func (e *EndStage) Response() *admission_api.AdmissionResponse

type GivenStage

type GivenStage struct {
	BaseStage
	*admission_api.AdmissionRequest
}

func Given

func Given(logger logr.Logger, k8s *k8s.Interface) *GivenStage

func (*GivenStage) A

func (g *GivenStage) A() *GivenStage

func (*GivenStage) An

func (g *GivenStage) An() *GivenStage

func (*GivenStage) And

func (g *GivenStage) And() *GivenStage

func (*GivenStage) End

func (g *GivenStage) End() *GivenStage

func (*GivenStage) Group

func (g *GivenStage) Group() *GivenStage

func (*GivenStage) Or

func (g *GivenStage) Or() *GivenStage

func (*GivenStage) Request

func (g *GivenStage) Request(request *admission_api.AdmissionRequest) *GivenStage

func (*GivenStage) RequestedObject

func (g *GivenStage) RequestedObject() *RequestedObjectStage

func (*GivenStage) The

func (g *GivenStage) The() *GivenStage

func (*GivenStage) When

func (g *GivenStage) When(hook Hook) *WhenStage

type Hook

type Hook interface {
	Review(s *GivenStage) *WhenStage
}

type PatchOperation

type PatchOperation struct {
	Op    string      `json:"op"`
	Path  string      `json:"path"`
	Value interface{} `json:"value,omitempty"`
}

PatchOperation one patch step

type Patcher

type Patcher interface {
	Create() ([]PatchOperation, error)
}

Patcher generate patch given the context

type PatcherStage

type PatcherStage struct {
	*GivenStage
}

type RequestedObjectStage

type RequestedObjectStage struct {
	*GivenStage
}

func (*RequestedObjectStage) And

func (*RequestedObjectStage) End

func (s *RequestedObjectStage) End() *GivenStage

func (*RequestedObjectStage) IsValid

func (*RequestedObjectStage) NamespaceIsNot

func (s *RequestedObjectStage) NamespaceIsNot(name string) *RequestedObjectStage

func (*RequestedObjectStage) Or

func (*RequestedObjectStage) The

type ResponseType

type ResponseType int8

type ThenStage

type ThenStage struct {
	*WhenStage
}

func (*ThenStage) Can

func (t *ThenStage) Can() *ThenStage

func (*ThenStage) End

func (t *ThenStage) End() *EndStage

*

  • End

func (*ThenStage) I

func (t *ThenStage) I() *ThenStage

func (*ThenStage) OrElse

func (t *ThenStage) OrElse() *ThenStage

func (*ThenStage) ReturnThePatch

func (t *ThenStage) ReturnThePatch() *ThenStage

func (*ThenStage) ReturnTheStatus

func (t *ThenStage) ReturnTheStatus() *ThenStage

type WhenStage

type WhenStage struct {
	*GivenStage
	Patcher
	Patch []PatchOperation
}

func (*WhenStage) I

func (w *WhenStage) I() *WhenStage

func (*WhenStage) PatchTheRequest

func (w *WhenStage) PatchTheRequest() *WhenStage

func (*WhenStage) Then

func (w *WhenStage) Then() *ThenStage

Jump to

Keyboard shortcuts

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