Last active
October 27, 2017 09:42
-
-
Save sttts/fa5d9d63dc1077c90005aa3fe2fc052d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Register registers a plugin | |
func Register(plugins *admission.Plugins) { | |
plugins.Register("LimitPodHardAntiAffinityTopology", func(config io.Reader) (admission.Interface, error) { | |
return NewInterPodAntiAffinity(), nil | |
}) | |
} | |
// plugin contains the client used by the admission controller | |
type plugin struct { | |
*admission.Handler | |
} | |
// NewInterPodAntiAffinity creates a new instance of the LimitPodHardAntiAffinityTopology admission controller | |
func NewInterPodAntiAffinity() *plugin { | |
return &plugin{ | |
Handler: admission.NewHandler(admission.Create, admission.Update), | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Register registers a Plugin | |
func Register(plugins *admission.Plugins) { | |
plugins.Register("LimitPodHardAntiAffinityTopology", func(config io.Reader) (admission.Interface, error) { | |
return NewInterPodAntiAffinity(), nil | |
}) | |
} | |
type hiddenHandler struct{ admission.Handler } | |
// Plugin contains the client used by the admission controller | |
type Plugin struct { | |
hiddenHandler | |
} | |
// NewInterPodAntiAffinity creates a new instance of the LimitPodHardAntiAffinityTopology admission controller | |
func NewInterPodAntiAffinity() *Plugin { | |
return &Plugin{ | |
hiddenHandler: hiddenHandler{Handler: *admission.NewHandler(admission.Create, admission.Update)}, | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Register registers a plugin | |
func Register(plugins *admission.Plugins) { | |
plugins.Register("LimitPodHardAntiAffinityTopology", func(config io.Reader) (admission.Interface, error) { | |
return NewInterPodAntiAffinity(), nil | |
}) | |
} | |
type Plugin interface { | |
admission.Interface | |
// here more interfaces will follow: | |
// admission.MutatingInterface | |
// admission.ValidatingInterface | |
} | |
// plugin contains the client used by the admission controller | |
type plugin struct { | |
*admission.Handler | |
} | |
// NewInterPodAntiAffinity creates a new instance of the LimitPodHardAntiAffinityTopology admission controller | |
func NewInterPodAntiAffinity() Plugin { | |
return &plugin{ | |
Handler: admission.NewHandler(admission.Create, admission.Update), | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment