|
|
@ -54,6 +54,8 @@ var ErrNoObjectsVisited = errors.New("no objects visited")
|
|
|
|
type Client struct {
|
|
|
|
type Client struct {
|
|
|
|
Factory Factory
|
|
|
|
Factory Factory
|
|
|
|
Log func(string, ...interface{})
|
|
|
|
Log func(string, ...interface{})
|
|
|
|
|
|
|
|
// Namespace allows to bypass the kubeconfig file for the choice of the namespace
|
|
|
|
|
|
|
|
Namespace string
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var addToScheme sync.Once
|
|
|
|
var addToScheme sync.Once
|
|
|
@ -115,6 +117,9 @@ func (c *Client) Wait(resources ResourceList, timeout time.Duration) error {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (c *Client) namespace() string {
|
|
|
|
func (c *Client) namespace() string {
|
|
|
|
|
|
|
|
if c.Namespace != "" {
|
|
|
|
|
|
|
|
return c.Namespace
|
|
|
|
|
|
|
|
}
|
|
|
|
if ns, _, err := c.Factory.ToRawKubeConfigLoader().Namespace(); err == nil {
|
|
|
|
if ns, _, err := c.Factory.ToRawKubeConfigLoader().Namespace(); err == nil {
|
|
|
|
return ns
|
|
|
|
return ns
|
|
|
|
}
|
|
|
|
}
|
|
|
|