From 75e28b0dd48a3a2d90d1bbb8133114134c6d0528 Mon Sep 17 00:00:00 2001 From: David Eads Date: Mon, 23 Jul 2018 16:29:35 -0400 Subject: [PATCH] add missing OrDie variant for dynamic client construction --- staging/src/k8s.io/client-go/dynamic/simple.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/staging/src/k8s.io/client-go/dynamic/simple.go b/staging/src/k8s.io/client-go/dynamic/simple.go index 88e9cc2b06bb4..2bc7b50e5c783 100644 --- a/staging/src/k8s.io/client-go/dynamic/simple.go +++ b/staging/src/k8s.io/client-go/dynamic/simple.go @@ -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