add missing OrDie variant for dynamic client construction

This commit is contained in:
David Eads 2018-07-23 16:29:35 -04:00
parent 446cf20c9f
commit 75e28b0dd4

View File

@ -36,6 +36,16 @@ type dynamicClient struct {
var _ Interface = &dynamicClient{}
// NewForConfigOrDie creates a new Interface for the given config and
// panics if there is an error in the config.
func NewForConfigOrDie(c *rest.Config) Interface {
ret, err := NewForConfig(c)
if err != nil {
panic(err)
}
return ret
}
func NewForConfig(inConfig *rest.Config) (Interface, error) {
config := rest.CopyConfig(inConfig)
// for serializing the options