const PluginName … // Register registers a plugin func Register(plugins *admission.Plugins) { … } type claimDefaulterPlugin … var _ … var _ … var _ … // newPlugin creates a new admission plugin. func newPlugin() *claimDefaulterPlugin { … } func (a *claimDefaulterPlugin) SetExternalKubeInformerFactory(f informers.SharedInformerFactory) { … } // ValidateInitialization ensures lister is set. func (a *claimDefaulterPlugin) ValidateInitialization() error { … } // Admit sets the default value of a PersistentVolumeClaim's storage class, in case the user did // not provide a value. // // 1. Find available StorageClasses. // 2. Figure which is the default // 3. Write to the PVClaim func (a *claimDefaulterPlugin) Admit(ctx context.Context, attr admission.Attributes, o admission.ObjectInterfaces) error { … }