webhooks

package
v0.0.0-...-e779149 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Copyright 2022 The KubeSphere Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2022 The KubeSphere Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDefaulter

func RegisterDefaulter(name string, d *DefaulterWrap)

func RegisterValidator

func RegisterValidator(name string, v *ValidatorWrap)

func UnRegisterDefaulter

func UnRegisterDefaulter(name string)

func UnRegisterValidator

func UnRegisterValidator(name string)

Types

type AccessorHandler

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

func (*AccessorHandler) Handle

func (*AccessorHandler) InjectDecoder

func (h *AccessorHandler) InjectDecoder(d *admission.Decoder) error

type Defaulter

type Defaulter interface {
	Default(obj runtime.Object) error
}

Defaulter defines functions for setting defaults on resources

type DefaulterWrap

type DefaulterWrap struct {
	Obj    runtime.Object
	Helper Defaulter
}

func GetDefaulter

func GetDefaulter(name string) *DefaulterWrap

type MutatingHandler

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

func (*MutatingHandler) Handle

Handle handles admission requests.

func (*MutatingHandler) InjectDecoder

func (h *MutatingHandler) InjectDecoder(d *admission.Decoder) error

InjectDecoder injects the decoder into a MutatingHandler.

type ValidatingHandler

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

func (*ValidatingHandler) Handle

Handle handles admission requests.

func (*ValidatingHandler) InjectDecoder

func (h *ValidatingHandler) InjectDecoder(d *admission.Decoder) error

InjectDecoder injects the decoder into a ValidatingHandler.

type Validator

type Validator interface {
	ValidateCreate(obj runtime.Object) error
	ValidateUpdate(old runtime.Object, new runtime.Object) error
	ValidateDelete(obj runtime.Object) error
}

Validator defines functions for validating an operation

type ValidatorWrap

type ValidatorWrap struct {
	Obj    runtime.Object
	Helper Validator
}

func GetValidator

func GetValidator(name string) *ValidatorWrap

Jump to

Keyboard shortcuts

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