const PluginName … // Register is called by the apiserver to register the plugin factory. func Register(plugins *admission.Plugins) { … } // newExtendedResourceToleration creates a new instance of the ExtendedResourceToleration admission controller. func newExtendedResourceToleration() *plugin { … } var _ … type plugin … // Admit updates the toleration of a pod based on the resources requested by it. // If an extended resource of name "example.com/device" is requested, it adds // a toleration with key "example.com/device", operator "Exists" and effect "NoSchedule". // The rationale for this is described in: // https://github.com/kubernetes/kubernetes/issues/55080 func (p *plugin) Admit(ctx context.Context, attributes admission.Attributes, o admission.ObjectInterfaces) error { … }