Documentation
¶
Index ¶
- Constants
- func InPrivilegedUsersList(ctx *pkgctx.WebhookContext, userInfo authv1.UserInfo) bool
- func IsKubeAdmin(ctx *pkgctx.WebhookContext, userInfo authv1.UserInfo) bool
- func IsPrivilegedAccount(ctx *pkgctx.WebhookContext, userInfo authv1.UserInfo) bool
- func IsSystemMasters(ctx *pkgctx.WebhookContext, userInfo authv1.UserInfo) bool
- func IsVMOperatorServiceAccount(ctx *pkgctx.WebhookContext, userInfo authv1.UserInfo) bool
- func VerifyWebhookRequest(ctx context.Context) error
- type MutatingWebhook
- type Mutator
- type MutatorFunc
- type ValidatingWebhook
- type Validator
- type ValidatorFunc
Constants ¶
View Source
const ( AdmitMesgUpdateOnDeleting = "Update is allowed during deletion in order to remove the finalizers." SkipValidationAllowed = "Allowed due to skipping validation" SkipValidationDenied = "Denied due to skipping validation" )
View Source
const ( // RequestClientCertificateContextKey is the key used to store and extract // client cert data from http requests. RequestClientCertificateContextKey contextKey = iota )
Variables ¶
This section is empty.
Functions ¶
func InPrivilegedUsersList ¶ added in v1.10.0
func InPrivilegedUsersList( ctx *pkgctx.WebhookContext, userInfo authv1.UserInfo) bool
func IsKubeAdmin ¶ added in v1.10.0
func IsKubeAdmin( ctx *pkgctx.WebhookContext, userInfo authv1.UserInfo) bool
func IsPrivilegedAccount ¶ added in v1.8.5
func IsPrivilegedAccount( ctx *pkgctx.WebhookContext, userInfo authv1.UserInfo) bool
func IsSystemMasters ¶ added in v1.10.0
func IsSystemMasters( ctx *pkgctx.WebhookContext, userInfo authv1.UserInfo) bool
func IsVMOperatorServiceAccount ¶ added in v1.10.0
func IsVMOperatorServiceAccount( ctx *pkgctx.WebhookContext, userInfo authv1.UserInfo) bool
func VerifyWebhookRequest ¶ added in v1.10.0
Types ¶
type MutatingWebhook ¶
type MutatingWebhook struct {
admission.Webhook
// Name is the name of the webhook.
Name string
// Path is the path of the webhook.
Path string
}
MutatingWebhook is an admissions webhook that mutates VM Operator resources.
func NewMutatingWebhook ¶
func NewMutatingWebhook( ctx *pkgctx.ControllerManagerContext, mgr ctrlmgr.Manager, webhookName string, mutator Mutator) (*MutatingWebhook, error)
NewMutatingWebhook returns a new admissions webhook for mutating requests.
type Mutator ¶
type Mutator interface {
// For returns the GroupVersionKind for which this webhook mutates requests.
For() schema.GroupVersionKind
// Mutate will try modify invalid value.
Mutate(*pkgctx.WebhookRequestContext) admission.Response
}
Mutator is used to create a new admissions webhook for mutating requests.
type MutatorFunc ¶
type ValidatingWebhook ¶
type ValidatingWebhook struct {
admission.Webhook
// Name is the name of the webhook.
Name string
// Path is the path of the webhook.
Path string
}
ValidatingWebhook is an admissions webhook that validates resources.
func NewValidatingWebhook ¶
func NewValidatingWebhook( ctx *pkgctx.ControllerManagerContext, mgr ctrlmgr.Manager, webhookName string, validator Validator) (*ValidatingWebhook, error)
NewValidatingWebhook returns a new admissions webhook for validating requests.
type Validator ¶
type Validator interface {
// For returns the GroupVersionKind for which this webhook validates requests.
For() schema.GroupVersionKind
// ValidateCreate returns nil if the request is valid.
ValidateCreate(*pkgctx.WebhookRequestContext) admission.Response
// ValidateDelete returns nil if the request is valid.
ValidateDelete(*pkgctx.WebhookRequestContext) admission.Response
// ValidateUpdate returns nil if the request is valid.
ValidateUpdate(*pkgctx.WebhookRequestContext) admission.Response
}
Validator is used to create a new admissions webhook for validating requests.
type ValidatorFunc ¶
Click to show internal directories.
Click to hide internal directories.