add missing OrDie variant for dynamic client construction

Kubernetes-commit: 75e28b0dd48a3a2d90d1bbb8133114134c6d0528
This commit is contained in:
David Eads 2018-07-23 16:29:35 -04:00 committed by Kubernetes Publisher
parent 739dd8f9d4
commit 875f881c7c

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