const PluginName … // Register registers a plugin func Register(plugins *admission.Plugins) { … } type Plugin … var _ … // NewInterPodAntiAffinity creates a new instance of the LimitPodHardAntiAffinityTopology admission controller func NewInterPodAntiAffinity() *Plugin { … } // Validate will deny any pod that defines AntiAffinity topology key other than v1.LabelHostname i.e. "kubernetes.io/hostname" // in requiredDuringSchedulingRequiredDuringExecution and requiredDuringSchedulingIgnoredDuringExecution. func (p *Plugin) Validate(ctx context.Context, attributes admission.Attributes, o admission.ObjectInterfaces) (err error) { … }