Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertToUnstructured(resourceObject runtime.Object) (resource *unstructured.Unstructured)
- func DeserializeResource(resourceRawExtension *runtime.RawExtension, fldPath *field.Path) (resource runtime.Object, allErrs field.ErrorList)
- type ResourceDistributionCreateUpdateHandler
Constants ¶
View Source
const ( DefaultNamespace = "default" ResourceHashCodeAnnotation = "kruise.io/resourcedistribution.resource.hashcode" ResourceDistributedTimestamp = "kruise.io/resourcedistribution.resource.distributed.timestamp" SourceResourceDistributionOfResource = "kruise.io/resourcedistribution.resource.from" )
Variables ¶
View Source
var ( // ForbiddenNamespaces is a list that contains all forbidden namespaces // Resources will never be distributed to these namespaces // reused by controller /* ADD NEW FORBIDDEN NAMESPACE HERE*/ ForbiddenNamespaces = []string{ "kube-system", "kube-public", } )
View Source
var ( // HandlerMap contains admission webhook handlers HandlerMap = map[string]admission.Handler{ "validate-apps-kruise-io-v1alpha1-resourcedistribution": &ResourceDistributionCreateUpdateHandler{}, } )
Functions ¶
func ConvertToUnstructured ¶
func ConvertToUnstructured(resourceObject runtime.Object) (resource *unstructured.Unstructured)
ConvertToUnstructured receive runtime.Object, return *unstructured.Unstructured reused by controller
func DeserializeResource ¶
func DeserializeResource(resourceRawExtension *runtime.RawExtension, fldPath *field.Path) (resource runtime.Object, allErrs field.ErrorList)
DeserializeResource receive yaml of resource, return runtime.Object reused by controller
Types ¶
type ResourceDistributionCreateUpdateHandler ¶
type ResourceDistributionCreateUpdateHandler struct { Client client.Client // Decoder decodes objects Decoder *admission.Decoder }
ResourceDistributionCreateUpdateHandler handles ResourceDistribution
func (*ResourceDistributionCreateUpdateHandler) Handle ¶
func (h *ResourceDistributionCreateUpdateHandler) Handle(ctx context.Context, req admission.Request) admission.Response
Handle handles admission requests.
func (*ResourceDistributionCreateUpdateHandler) InjectClient ¶
func (h *ResourceDistributionCreateUpdateHandler) InjectClient(c client.Client) error
InjectClient injects the client into the ResourceDistributionCreateUpdateHandler
func (*ResourceDistributionCreateUpdateHandler) InjectDecoder ¶
func (h *ResourceDistributionCreateUpdateHandler) InjectDecoder(d *admission.Decoder) error
InjectDecoder injects the decoder into the ResourceDistributionCreateUpdateHandler
Click to show internal directories.
Click to hide internal directories.