chimera

package
v0.0.0-...-4ff1449 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 26 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartServer

func StartServer(config *AdmissionConfig, insecure bool) error

Types

type AdmissionConfig

type AdmissionConfig struct {
	Name                      string
	KubeNamespace             string
	KubeService               string
	CallbackHost              string
	CallbackPort              int
	Webhooks                  WebhookList
	TLSExtraSANs              []string
	CertFile                  string
	KeyFile                   string
	CaFile                    string
	SkipAdmissionRegistration bool
	Log                       Logger
}

type KeyPair

type KeyPair struct {
	PublicKey  string
	PrivateKey string
	// contains filtered or unexported fields
}

KeyPair represents a public/private key pair

func (*KeyPair) Key

func (keyPair *KeyPair) Key() *rsa.PrivateKey

Key returns the RSA private key for this private key pair

type Logger

type Logger interface {
	Debug(msg string)
	Debugf(format string, args ...interface{})
	Info(msg string)
	Infof(format string, args ...interface{})
	Error(msg string)
	Errorf(format string, args ...interface{})
}

type Webhook

type Webhook struct {
	Rules         []admissionregistrationv1.RuleWithOperations
	Callback      WebhookCallback
	FailurePolicy admissionregistrationv1.FailurePolicyType // +optional
	Name          string                                    // +optional
	Path          string                                    // +optional
}

type WebhookCallback

type WebhookCallback func(*admissionv1.AdmissionRequest) (WebhookResponse, error)

type WebhookList

type WebhookList []Webhook

type WebhookResponse

type WebhookResponse struct {
	Allowed          bool
	Code             *int32  // +optional, ignored if allowed
	RejectionMessage *string // +optional, ignored if allowed
}

func NewAllowRequest

func NewAllowRequest() WebhookResponse

func NewRejectRequest

func NewRejectRequest() WebhookResponse

func (WebhookResponse) WithCode

func (r WebhookResponse) WithCode(code int32) WebhookResponse

func (WebhookResponse) WithMessage

func (r WebhookResponse) WithMessage(message string) WebhookResponse

Jump to

Keyboard shortcuts

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