From 875f881c7c6fd59c7cee692d85256d59e124da32 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 Kubernetes-commit: 75e28b0dd48a3a2d90d1bbb8133114134c6d0528 --- dynamic/simple.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dynamic/simple.go b/dynamic/simple.go index 88e9cc2b..2bc7b50e 100644 --- a/dynamic/simple.go +++ b/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