diff --git a/README.md b/README.md index 83ab35a..9cd14af 100644 --- a/README.md +++ b/README.md @@ -46,14 +46,10 @@ This client supports every API group version present since 1.3. ### Namespaces -Clients are initialized with a default namespace. For in-cluster clients, this is the namespace the pod was deployed in. - ```go -pods, err := client.ListPods(ctx, "") // Pods in the current namespace. +pods, err := client.ListPods(ctx, k8s.AllNamespaces) // Pods in all namespaces. ``` -This can be overridden by explicitly passing a namespace. - ```go pods, err := client.ListPods(ctx, "custom-namespace") // Pods from the "custom-namespace" ``` diff --git a/client.go b/client.go index 7d91e55..72f61ba 100644 --- a/client.go +++ b/client.go @@ -43,6 +43,14 @@ import ( "github.com/golang/protobuf/proto" ) +const ( + // AllNamespaces is given to list and watch operations to signify that the code should + // list or watch resources in all namespaces. + AllNamespaces = allNamespaces + // Actual definition is private in case we want to change it later. + allNamespaces = "" +) + // String returns a pointer to a string. Useful for creating API objects // that take pointers instead of literals. // @@ -369,13 +377,6 @@ func (c *Client) client() *http.Client { return c.Client } -func (c *Client) namespaceFor(namespace string) string { - if namespace != "" { - return namespace - } - return c.Namespace -} - // The following methods hold the logic for interacting with the Kubernetes API. Generated // clients are thin wrappers on top of these methods. // diff --git a/client_test.go b/client_test.go index 66d8a6b..f4d42e7 100644 --- a/client_test.go +++ b/client_test.go @@ -17,7 +17,7 @@ import ( ) const skipMsg = ` -warning: this package's test run using the default context of your "kubeclt" command, +warning: this package's test run using the default context of your "kubectl" command, and will create resources on your cluster (mostly configmaps). If you wish to continue set the following environment variable: @@ -247,3 +247,133 @@ func TestWatch(t *testing.T) { } } } + +// TestWatchNamespace ensures that creating a configmap in a non-default namespace is not returned while watching the default namespace +func TestWatchNamespace(t *testing.T) { + client := newTestClient(t).CoreV1() + ctx, cancel := context.WithCancel(context.Background()) + defer cancel() + + defaultWatch, err := client.WatchConfigMaps(ctx, "default") + if err != nil { + t.Fatal(err) + } + defer defaultWatch.Close() + + allWatch, err := client.WatchConfigMaps(ctx, AllNamespaces) + if err != nil { + t.Fatal(err) + } + defer allWatch.Close() + + nonDefaultNamespaceName := newName() + defaultName := newName() + name := newName() + labelVal := newName() + + // Create a configmap in the default namespace so the "default" watch has something to return + defaultCM := &v1.ConfigMap{ + Metadata: &v1.ObjectMeta{ + Name: String(defaultName), + Namespace: String("default"), + Labels: map[string]string{ + "testLabel": labelVal, + }, + }, + Data: map[string]string{ + "foo": "bar", + }, + } + defaultGot, err := client.CreateConfigMap(ctx, defaultCM) + if err != nil { + t.Fatalf("create config map: %v", err) + } + + // Create a non-default Namespace + ns := &v1.Namespace{ + Metadata: &v1.ObjectMeta{ + Name: String(nonDefaultNamespaceName), + }, + } + if _, err := client.CreateNamespace(ctx, ns); err != nil { + t.Fatalf("create non-default-namespace: %v", err) + } + + // Create a configmap in the non-default namespace + nonDefaultCM := &v1.ConfigMap{ + Metadata: &v1.ObjectMeta{ + Name: String(name), + Namespace: String(nonDefaultNamespaceName), + Labels: map[string]string{ + "testLabel": labelVal, + }, + }, + Data: map[string]string{ + "foo": "bar", + }, + } + nonDefaultGot, err := client.CreateConfigMap(ctx, nonDefaultCM) + if err != nil { + t.Fatalf("create config map: %v", err) + } + + // Watching the default namespace should not return the non-default namespace configmap, + // and instead return the previously created configmap in the default namespace + if _, gotFromWatch, err := defaultWatch.Next(); err != nil { + t.Errorf("failed to get next watch: %v", err) + } else { + if reflect.DeepEqual(nonDefaultGot, gotFromWatch) { + t.Errorf("config map in non-default namespace returned while watching default namespace") + } + if !reflect.DeepEqual(defaultGot, gotFromWatch) { + t.Errorf("object from add event did not match expected value") + } + } + + // However, watching all-namespaces should contain both the default and non-default namespaced configmaps + if _, gotFromWatch, err := allWatch.Next(); err != nil { + t.Errorf("failed to get next watch: %v", err) + } else { + if !reflect.DeepEqual(defaultGot, gotFromWatch) { + t.Errorf("watching all namespaces did not return the expected configmap") + } + } + + if _, gotFromWatch, err := allWatch.Next(); err != nil { + t.Errorf("failed to get next watch: %v", err) + } else { + if !reflect.DeepEqual(nonDefaultGot, gotFromWatch) { + t.Errorf("watching all namespaces did not return the expected configmap") + } + } + + // Delete the config map in the default namespace first, then delete the non-default namespace config map. + // Only the former should be noticed by the default-watch. + + if err := client.DeleteConfigMap(ctx, *defaultCM.Metadata.Name, *defaultCM.Metadata.Namespace); err != nil { + t.Fatalf("delete config map: %v", err) + } + if err := client.DeleteConfigMap(ctx, *nonDefaultCM.Metadata.Name, *nonDefaultCM.Metadata.Namespace); err != nil { + t.Fatalf("delete config map: %v", err) + } + + if event, gotFromWatch, err := defaultWatch.Next(); err != nil { + t.Errorf("failed to get next watch: %v", err) + } else { + if *event.Type != EventDeleted { + t.Errorf("expected event type %q got %q", EventDeleted, *event.Type) + } + + // Resource version will be different after a delete + nonDefaultGot.Metadata.ResourceVersion = String("") + gotFromWatch.Metadata.ResourceVersion = String("") + + if reflect.DeepEqual(nonDefaultGot, gotFromWatch) { + t.Errorf("should not have received event from non-default namespace while watching default namespace") + } + } + + if err := client.DeleteNamespace(ctx, nonDefaultNamespaceName); err != nil { + t.Fatalf("delete namespace: %v", err) + } +} diff --git a/gen.go b/gen.go index 802fa4e..cbfd003 100644 --- a/gen.go +++ b/gen.go @@ -115,7 +115,7 @@ func (c *{{ $.Name }}) Create{{ $r.Name }}(ctx context.Context, obj *{{ $.Import } if {{ $r.Namespaced }} { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -144,7 +144,7 @@ func (c *{{ $.Name }}) Update{{ $r.Name }}(ctx context.Context, obj *{{ $.Import } if {{ $r.Namespaced }} { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -162,12 +162,7 @@ func (c *{{ $.Name }}) Delete{{ $r.Name }}(ctx context.Context, name string{{ if if name == "" { return fmt.Errorf("create: no name for given object") } - {{ if $r.Namespaced -}} - ns := c.client.namespaceFor(namespace) - {{ else -}} - ns := "" - {{ end }} - url := c.client.urlFor("{{ $.APIGroup }}", "{{ $.APIVersion }}", ns, "{{ $r.Pluralized }}", name) + url := c.client.urlFor("{{ $.APIGroup }}", "{{ $.APIVersion }}", {{ if $r.Namespaced }}namespace{{ else }}AllNamespaces{{ end }}, "{{ $r.Pluralized }}", name) return c.client.delete(ctx, pbCodec, url) } @@ -175,12 +170,7 @@ func (c *{{ $.Name }}) Get{{ $r.Name }}(ctx context.Context, name{{ if $r.Namesp if name == "" { return nil, fmt.Errorf("create: no name for given object") } - {{ if $r.Namespaced -}} - ns := c.client.namespaceFor(namespace) - {{ else -}} - ns := "" - {{ end }} - url := c.client.urlFor("{{ $.APIGroup }}", "{{ $.APIVersion }}", ns, "{{ $r.Pluralized }}", name) + url := c.client.urlFor("{{ $.APIGroup }}", "{{ $.APIVersion }}", {{ if $r.Namespaced }}namespace{{ else }}AllNamespaces{{ end }}, "{{ $r.Pluralized }}", name) resp := new({{ $.ImportName }}.{{ $r.Name }}) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -211,12 +201,7 @@ func (w *{{ $.Name }}{{ $r.Name }}Watcher) Close() error { } func (c *{{ $.Name }}) Watch{{ $r.Name | pluralize }}(ctx context.Context{{ if $r.Namespaced }}, namespace string{{ end }}, options ...Option) (*{{ $.Name }}{{ $r.Name }}Watcher, error) { - {{ if $r.Namespaced -}} - ns := c.client.namespaceFor(namespace) - {{ else -}} - ns := "" - {{- end }} - url := c.client.urlFor("{{ $.APIGroup }}", "{{ $.APIVersion }}", ns, "{{ $r.Pluralized }}", "", options...) + url := c.client.urlFor("{{ $.APIGroup }}", "{{ $.APIVersion }}", {{ if $r.Namespaced }}namespace{{ else }}AllNamespaces{{ end }}, "{{ $r.Pluralized }}", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -225,12 +210,7 @@ func (c *{{ $.Name }}) Watch{{ $r.Name | pluralize }}(ctx context.Context{{ if $ } func (c *{{ $.Name }}) List{{ $r.Name | pluralize }}(ctx context.Context{{ if $r.Namespaced }}, namespace string{{ end }}, options ...Option) (*{{ $.ImportName }}.{{ $r.Name }}List, error) { - {{ if $r.Namespaced -}} - ns := c.client.namespaceFor(namespace) - {{ else -}} - ns := "" - {{- end }} - url := c.client.urlFor("{{ $.APIGroup }}", "{{ $.APIVersion }}", ns, "{{ $r.Pluralized }}", "", options...) + url := c.client.urlFor("{{ $.APIGroup }}", "{{ $.APIVersion }}", {{ if $r.Namespaced }}namespace{{ else }}AllNamespaces{{ end }}, "{{ $r.Pluralized }}", "", options...) resp := new({{ $.ImportName }}.{{ $r.Name }}List) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err diff --git a/tprs.go b/tprs.go index db9533a..7ea5385 100644 --- a/tprs.go +++ b/tprs.go @@ -115,46 +115,41 @@ type object interface { } func (t *ThirdPartyResources) Create(ctx context.Context, resource, namespace string, req, resp interface{}) error { - ns := t.c.namespaceFor(namespace) - if err := checkResource(t.apiGroup, t.apiVersion, resource, ns, "not required"); err != nil { + if err := checkResource(t.apiGroup, t.apiVersion, resource, namespace, "not required"); err != nil { return err } - url := t.c.urlFor(t.apiGroup, t.apiVersion, ns, resource, "") + url := t.c.urlFor(t.apiGroup, t.apiVersion, namespace, resource, "") return t.c.create(ctx, jsonCodec, "POST", url, req, resp) } func (t *ThirdPartyResources) Update(ctx context.Context, resource, namespace, name string, req, resp interface{}) error { - ns := t.c.namespaceFor(namespace) - if err := checkResource(t.apiGroup, t.apiVersion, resource, ns, "not required"); err != nil { + if err := checkResource(t.apiGroup, t.apiVersion, resource, namespace, "not required"); err != nil { return err } - url := t.c.urlFor(t.apiGroup, t.apiVersion, ns, resource, name) + url := t.c.urlFor(t.apiGroup, t.apiVersion, namespace, resource, name) return t.c.create(ctx, jsonCodec, "PUT", url, req, resp) } func (t *ThirdPartyResources) Get(ctx context.Context, resource, namespace, name string, resp interface{}) error { - ns := t.c.namespaceFor(namespace) - if err := checkResource(t.apiGroup, t.apiVersion, resource, ns, name); err != nil { + if err := checkResource(t.apiGroup, t.apiVersion, resource, namespace, name); err != nil { return err } - url := t.c.urlFor(t.apiGroup, t.apiVersion, ns, resource, name) + url := t.c.urlFor(t.apiGroup, t.apiVersion, namespace, resource, name) return t.c.get(ctx, jsonCodec, url, resp) } func (t *ThirdPartyResources) Delete(ctx context.Context, resource, namespace, name string) error { - ns := t.c.namespaceFor(namespace) - if err := checkResource(t.apiGroup, t.apiVersion, resource, ns, name); err != nil { + if err := checkResource(t.apiGroup, t.apiVersion, resource, namespace, name); err != nil { return err } - url := t.c.urlFor(t.apiGroup, t.apiVersion, ns, resource, name) + url := t.c.urlFor(t.apiGroup, t.apiVersion, namespace, resource, name) return t.c.delete(ctx, jsonCodec, url) } func (t *ThirdPartyResources) List(ctx context.Context, resource, namespace string, resp interface{}) error { - ns := t.c.namespaceFor(namespace) - if err := checkResource(t.apiGroup, t.apiVersion, resource, ns, "name not required"); err != nil { + if err := checkResource(t.apiGroup, t.apiVersion, resource, namespace, "name not required"); err != nil { return err } - url := t.c.urlFor(t.apiGroup, t.apiVersion, ns, resource, "") + url := t.c.urlFor(t.apiGroup, t.apiVersion, namespace, resource, "") return t.c.get(ctx, jsonCodec, url, resp) } diff --git a/types.go b/types.go index 25a6beb..d3c9389 100644 --- a/types.go +++ b/types.go @@ -48,7 +48,7 @@ func (c *CoreV1) CreateBinding(ctx context.Context, obj *apiv1.Binding) (*apiv1. } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -77,7 +77,7 @@ func (c *CoreV1) UpdateBinding(ctx context.Context, obj *apiv1.Binding) (*apiv1. } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -95,9 +95,7 @@ func (c *CoreV1) DeleteBinding(ctx context.Context, name string, namespace strin if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "bindings", name) + url := c.client.urlFor("", "v1", namespace, "bindings", name) return c.client.delete(ctx, pbCodec, url) } @@ -105,9 +103,7 @@ func (c *CoreV1) GetBinding(ctx context.Context, name, namespace string) (*apiv1 if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "bindings", name) + url := c.client.urlFor("", "v1", namespace, "bindings", name) resp := new(apiv1.Binding) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -130,7 +126,7 @@ func (c *CoreV1) CreateComponentStatus(ctx context.Context, obj *apiv1.Component } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -159,7 +155,7 @@ func (c *CoreV1) UpdateComponentStatus(ctx context.Context, obj *apiv1.Component } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -177,9 +173,7 @@ func (c *CoreV1) DeleteComponentStatus(ctx context.Context, name string) error { if name == "" { return fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("", "v1", ns, "componentstatuses", name) + url := c.client.urlFor("", "v1", AllNamespaces, "componentstatuses", name) return c.client.delete(ctx, pbCodec, url) } @@ -187,9 +181,7 @@ func (c *CoreV1) GetComponentStatus(ctx context.Context, name string) (*apiv1.Co if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("", "v1", ns, "componentstatuses", name) + url := c.client.urlFor("", "v1", AllNamespaces, "componentstatuses", name) resp := new(apiv1.ComponentStatus) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -218,8 +210,7 @@ func (w *CoreV1ComponentStatusWatcher) Close() error { } func (c *CoreV1) WatchComponentStatuses(ctx context.Context, options ...Option) (*CoreV1ComponentStatusWatcher, error) { - ns := "" - url := c.client.urlFor("", "v1", ns, "componentstatuses", "", options...) + url := c.client.urlFor("", "v1", AllNamespaces, "componentstatuses", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -228,8 +219,7 @@ func (c *CoreV1) WatchComponentStatuses(ctx context.Context, options ...Option) } func (c *CoreV1) ListComponentStatuses(ctx context.Context, options ...Option) (*apiv1.ComponentStatusList, error) { - ns := "" - url := c.client.urlFor("", "v1", ns, "componentstatuses", "", options...) + url := c.client.urlFor("", "v1", AllNamespaces, "componentstatuses", "", options...) resp := new(apiv1.ComponentStatusList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -252,7 +242,7 @@ func (c *CoreV1) CreateConfigMap(ctx context.Context, obj *apiv1.ConfigMap) (*ap } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -281,7 +271,7 @@ func (c *CoreV1) UpdateConfigMap(ctx context.Context, obj *apiv1.ConfigMap) (*ap } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -299,9 +289,7 @@ func (c *CoreV1) DeleteConfigMap(ctx context.Context, name string, namespace str if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "configmaps", name) + url := c.client.urlFor("", "v1", namespace, "configmaps", name) return c.client.delete(ctx, pbCodec, url) } @@ -309,9 +297,7 @@ func (c *CoreV1) GetConfigMap(ctx context.Context, name, namespace string) (*api if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "configmaps", name) + url := c.client.urlFor("", "v1", namespace, "configmaps", name) resp := new(apiv1.ConfigMap) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -340,9 +326,7 @@ func (w *CoreV1ConfigMapWatcher) Close() error { } func (c *CoreV1) WatchConfigMaps(ctx context.Context, namespace string, options ...Option) (*CoreV1ConfigMapWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "configmaps", "", options...) + url := c.client.urlFor("", "v1", namespace, "configmaps", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -351,9 +335,7 @@ func (c *CoreV1) WatchConfigMaps(ctx context.Context, namespace string, options } func (c *CoreV1) ListConfigMaps(ctx context.Context, namespace string, options ...Option) (*apiv1.ConfigMapList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "configmaps", "", options...) + url := c.client.urlFor("", "v1", namespace, "configmaps", "", options...) resp := new(apiv1.ConfigMapList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -376,7 +358,7 @@ func (c *CoreV1) CreateEndpoints(ctx context.Context, obj *apiv1.Endpoints) (*ap } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -405,7 +387,7 @@ func (c *CoreV1) UpdateEndpoints(ctx context.Context, obj *apiv1.Endpoints) (*ap } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -423,9 +405,7 @@ func (c *CoreV1) DeleteEndpoints(ctx context.Context, name string, namespace str if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "endpoints", name) + url := c.client.urlFor("", "v1", namespace, "endpoints", name) return c.client.delete(ctx, pbCodec, url) } @@ -433,9 +413,7 @@ func (c *CoreV1) GetEndpoints(ctx context.Context, name, namespace string) (*api if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "endpoints", name) + url := c.client.urlFor("", "v1", namespace, "endpoints", name) resp := new(apiv1.Endpoints) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -464,9 +442,7 @@ func (w *CoreV1EndpointsWatcher) Close() error { } func (c *CoreV1) WatchEndpoints(ctx context.Context, namespace string, options ...Option) (*CoreV1EndpointsWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "endpoints", "", options...) + url := c.client.urlFor("", "v1", namespace, "endpoints", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -475,9 +451,7 @@ func (c *CoreV1) WatchEndpoints(ctx context.Context, namespace string, options . } func (c *CoreV1) ListEndpoints(ctx context.Context, namespace string, options ...Option) (*apiv1.EndpointsList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "endpoints", "", options...) + url := c.client.urlFor("", "v1", namespace, "endpoints", "", options...) resp := new(apiv1.EndpointsList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -500,7 +474,7 @@ func (c *CoreV1) CreateEvent(ctx context.Context, obj *apiv1.Event) (*apiv1.Even } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -529,7 +503,7 @@ func (c *CoreV1) UpdateEvent(ctx context.Context, obj *apiv1.Event) (*apiv1.Even } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -547,9 +521,7 @@ func (c *CoreV1) DeleteEvent(ctx context.Context, name string, namespace string) if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "events", name) + url := c.client.urlFor("", "v1", namespace, "events", name) return c.client.delete(ctx, pbCodec, url) } @@ -557,9 +529,7 @@ func (c *CoreV1) GetEvent(ctx context.Context, name, namespace string) (*apiv1.E if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "events", name) + url := c.client.urlFor("", "v1", namespace, "events", name) resp := new(apiv1.Event) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -588,9 +558,7 @@ func (w *CoreV1EventWatcher) Close() error { } func (c *CoreV1) WatchEvents(ctx context.Context, namespace string, options ...Option) (*CoreV1EventWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "events", "", options...) + url := c.client.urlFor("", "v1", namespace, "events", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -599,9 +567,7 @@ func (c *CoreV1) WatchEvents(ctx context.Context, namespace string, options ...O } func (c *CoreV1) ListEvents(ctx context.Context, namespace string, options ...Option) (*apiv1.EventList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "events", "", options...) + url := c.client.urlFor("", "v1", namespace, "events", "", options...) resp := new(apiv1.EventList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -624,7 +590,7 @@ func (c *CoreV1) CreateLimitRange(ctx context.Context, obj *apiv1.LimitRange) (* } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -653,7 +619,7 @@ func (c *CoreV1) UpdateLimitRange(ctx context.Context, obj *apiv1.LimitRange) (* } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -671,9 +637,7 @@ func (c *CoreV1) DeleteLimitRange(ctx context.Context, name string, namespace st if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "limitranges", name) + url := c.client.urlFor("", "v1", namespace, "limitranges", name) return c.client.delete(ctx, pbCodec, url) } @@ -681,9 +645,7 @@ func (c *CoreV1) GetLimitRange(ctx context.Context, name, namespace string) (*ap if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "limitranges", name) + url := c.client.urlFor("", "v1", namespace, "limitranges", name) resp := new(apiv1.LimitRange) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -712,9 +674,7 @@ func (w *CoreV1LimitRangeWatcher) Close() error { } func (c *CoreV1) WatchLimitRanges(ctx context.Context, namespace string, options ...Option) (*CoreV1LimitRangeWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "limitranges", "", options...) + url := c.client.urlFor("", "v1", namespace, "limitranges", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -723,9 +683,7 @@ func (c *CoreV1) WatchLimitRanges(ctx context.Context, namespace string, options } func (c *CoreV1) ListLimitRanges(ctx context.Context, namespace string, options ...Option) (*apiv1.LimitRangeList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "limitranges", "", options...) + url := c.client.urlFor("", "v1", namespace, "limitranges", "", options...) resp := new(apiv1.LimitRangeList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -748,7 +706,7 @@ func (c *CoreV1) CreateNamespace(ctx context.Context, obj *apiv1.Namespace) (*ap } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -777,7 +735,7 @@ func (c *CoreV1) UpdateNamespace(ctx context.Context, obj *apiv1.Namespace) (*ap } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -795,9 +753,7 @@ func (c *CoreV1) DeleteNamespace(ctx context.Context, name string) error { if name == "" { return fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("", "v1", ns, "namespaces", name) + url := c.client.urlFor("", "v1", AllNamespaces, "namespaces", name) return c.client.delete(ctx, pbCodec, url) } @@ -805,9 +761,7 @@ func (c *CoreV1) GetNamespace(ctx context.Context, name string) (*apiv1.Namespac if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("", "v1", ns, "namespaces", name) + url := c.client.urlFor("", "v1", AllNamespaces, "namespaces", name) resp := new(apiv1.Namespace) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -836,8 +790,7 @@ func (w *CoreV1NamespaceWatcher) Close() error { } func (c *CoreV1) WatchNamespaces(ctx context.Context, options ...Option) (*CoreV1NamespaceWatcher, error) { - ns := "" - url := c.client.urlFor("", "v1", ns, "namespaces", "", options...) + url := c.client.urlFor("", "v1", AllNamespaces, "namespaces", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -846,8 +799,7 @@ func (c *CoreV1) WatchNamespaces(ctx context.Context, options ...Option) (*CoreV } func (c *CoreV1) ListNamespaces(ctx context.Context, options ...Option) (*apiv1.NamespaceList, error) { - ns := "" - url := c.client.urlFor("", "v1", ns, "namespaces", "", options...) + url := c.client.urlFor("", "v1", AllNamespaces, "namespaces", "", options...) resp := new(apiv1.NamespaceList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -870,7 +822,7 @@ func (c *CoreV1) CreateNode(ctx context.Context, obj *apiv1.Node) (*apiv1.Node, } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -899,7 +851,7 @@ func (c *CoreV1) UpdateNode(ctx context.Context, obj *apiv1.Node) (*apiv1.Node, } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -917,9 +869,7 @@ func (c *CoreV1) DeleteNode(ctx context.Context, name string) error { if name == "" { return fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("", "v1", ns, "nodes", name) + url := c.client.urlFor("", "v1", AllNamespaces, "nodes", name) return c.client.delete(ctx, pbCodec, url) } @@ -927,9 +877,7 @@ func (c *CoreV1) GetNode(ctx context.Context, name string) (*apiv1.Node, error) if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("", "v1", ns, "nodes", name) + url := c.client.urlFor("", "v1", AllNamespaces, "nodes", name) resp := new(apiv1.Node) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -958,8 +906,7 @@ func (w *CoreV1NodeWatcher) Close() error { } func (c *CoreV1) WatchNodes(ctx context.Context, options ...Option) (*CoreV1NodeWatcher, error) { - ns := "" - url := c.client.urlFor("", "v1", ns, "nodes", "", options...) + url := c.client.urlFor("", "v1", AllNamespaces, "nodes", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -968,8 +915,7 @@ func (c *CoreV1) WatchNodes(ctx context.Context, options ...Option) (*CoreV1Node } func (c *CoreV1) ListNodes(ctx context.Context, options ...Option) (*apiv1.NodeList, error) { - ns := "" - url := c.client.urlFor("", "v1", ns, "nodes", "", options...) + url := c.client.urlFor("", "v1", AllNamespaces, "nodes", "", options...) resp := new(apiv1.NodeList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -992,7 +938,7 @@ func (c *CoreV1) CreatePersistentVolume(ctx context.Context, obj *apiv1.Persiste } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -1021,7 +967,7 @@ func (c *CoreV1) UpdatePersistentVolume(ctx context.Context, obj *apiv1.Persiste } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -1039,9 +985,7 @@ func (c *CoreV1) DeletePersistentVolume(ctx context.Context, name string) error if name == "" { return fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("", "v1", ns, "persistentvolumes", name) + url := c.client.urlFor("", "v1", AllNamespaces, "persistentvolumes", name) return c.client.delete(ctx, pbCodec, url) } @@ -1049,9 +993,7 @@ func (c *CoreV1) GetPersistentVolume(ctx context.Context, name string) (*apiv1.P if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("", "v1", ns, "persistentvolumes", name) + url := c.client.urlFor("", "v1", AllNamespaces, "persistentvolumes", name) resp := new(apiv1.PersistentVolume) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -1080,8 +1022,7 @@ func (w *CoreV1PersistentVolumeWatcher) Close() error { } func (c *CoreV1) WatchPersistentVolumes(ctx context.Context, options ...Option) (*CoreV1PersistentVolumeWatcher, error) { - ns := "" - url := c.client.urlFor("", "v1", ns, "persistentvolumes", "", options...) + url := c.client.urlFor("", "v1", AllNamespaces, "persistentvolumes", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -1090,8 +1031,7 @@ func (c *CoreV1) WatchPersistentVolumes(ctx context.Context, options ...Option) } func (c *CoreV1) ListPersistentVolumes(ctx context.Context, options ...Option) (*apiv1.PersistentVolumeList, error) { - ns := "" - url := c.client.urlFor("", "v1", ns, "persistentvolumes", "", options...) + url := c.client.urlFor("", "v1", AllNamespaces, "persistentvolumes", "", options...) resp := new(apiv1.PersistentVolumeList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -1114,7 +1054,7 @@ func (c *CoreV1) CreatePersistentVolumeClaim(ctx context.Context, obj *apiv1.Per } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -1143,7 +1083,7 @@ func (c *CoreV1) UpdatePersistentVolumeClaim(ctx context.Context, obj *apiv1.Per } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -1161,9 +1101,7 @@ func (c *CoreV1) DeletePersistentVolumeClaim(ctx context.Context, name string, n if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "persistentvolumeclaims", name) + url := c.client.urlFor("", "v1", namespace, "persistentvolumeclaims", name) return c.client.delete(ctx, pbCodec, url) } @@ -1171,9 +1109,7 @@ func (c *CoreV1) GetPersistentVolumeClaim(ctx context.Context, name, namespace s if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "persistentvolumeclaims", name) + url := c.client.urlFor("", "v1", namespace, "persistentvolumeclaims", name) resp := new(apiv1.PersistentVolumeClaim) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -1202,9 +1138,7 @@ func (w *CoreV1PersistentVolumeClaimWatcher) Close() error { } func (c *CoreV1) WatchPersistentVolumeClaims(ctx context.Context, namespace string, options ...Option) (*CoreV1PersistentVolumeClaimWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "persistentvolumeclaims", "", options...) + url := c.client.urlFor("", "v1", namespace, "persistentvolumeclaims", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -1213,9 +1147,7 @@ func (c *CoreV1) WatchPersistentVolumeClaims(ctx context.Context, namespace stri } func (c *CoreV1) ListPersistentVolumeClaims(ctx context.Context, namespace string, options ...Option) (*apiv1.PersistentVolumeClaimList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "persistentvolumeclaims", "", options...) + url := c.client.urlFor("", "v1", namespace, "persistentvolumeclaims", "", options...) resp := new(apiv1.PersistentVolumeClaimList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -1238,7 +1170,7 @@ func (c *CoreV1) CreatePod(ctx context.Context, obj *apiv1.Pod) (*apiv1.Pod, err } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -1267,7 +1199,7 @@ func (c *CoreV1) UpdatePod(ctx context.Context, obj *apiv1.Pod) (*apiv1.Pod, err } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -1285,9 +1217,7 @@ func (c *CoreV1) DeletePod(ctx context.Context, name string, namespace string) e if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "pods", name) + url := c.client.urlFor("", "v1", namespace, "pods", name) return c.client.delete(ctx, pbCodec, url) } @@ -1295,9 +1225,7 @@ func (c *CoreV1) GetPod(ctx context.Context, name, namespace string) (*apiv1.Pod if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "pods", name) + url := c.client.urlFor("", "v1", namespace, "pods", name) resp := new(apiv1.Pod) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -1326,9 +1254,7 @@ func (w *CoreV1PodWatcher) Close() error { } func (c *CoreV1) WatchPods(ctx context.Context, namespace string, options ...Option) (*CoreV1PodWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "pods", "", options...) + url := c.client.urlFor("", "v1", namespace, "pods", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -1337,9 +1263,7 @@ func (c *CoreV1) WatchPods(ctx context.Context, namespace string, options ...Opt } func (c *CoreV1) ListPods(ctx context.Context, namespace string, options ...Option) (*apiv1.PodList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "pods", "", options...) + url := c.client.urlFor("", "v1", namespace, "pods", "", options...) resp := new(apiv1.PodList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -1362,7 +1286,7 @@ func (c *CoreV1) CreatePodStatusResult(ctx context.Context, obj *apiv1.PodStatus } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -1391,7 +1315,7 @@ func (c *CoreV1) UpdatePodStatusResult(ctx context.Context, obj *apiv1.PodStatus } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -1409,9 +1333,7 @@ func (c *CoreV1) DeletePodStatusResult(ctx context.Context, name string, namespa if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "podstatusresults", name) + url := c.client.urlFor("", "v1", namespace, "podstatusresults", name) return c.client.delete(ctx, pbCodec, url) } @@ -1419,9 +1341,7 @@ func (c *CoreV1) GetPodStatusResult(ctx context.Context, name, namespace string) if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "podstatusresults", name) + url := c.client.urlFor("", "v1", namespace, "podstatusresults", name) resp := new(apiv1.PodStatusResult) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -1444,7 +1364,7 @@ func (c *CoreV1) CreatePodTemplate(ctx context.Context, obj *apiv1.PodTemplate) } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -1473,7 +1393,7 @@ func (c *CoreV1) UpdatePodTemplate(ctx context.Context, obj *apiv1.PodTemplate) } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -1491,9 +1411,7 @@ func (c *CoreV1) DeletePodTemplate(ctx context.Context, name string, namespace s if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "podtemplates", name) + url := c.client.urlFor("", "v1", namespace, "podtemplates", name) return c.client.delete(ctx, pbCodec, url) } @@ -1501,9 +1419,7 @@ func (c *CoreV1) GetPodTemplate(ctx context.Context, name, namespace string) (*a if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "podtemplates", name) + url := c.client.urlFor("", "v1", namespace, "podtemplates", name) resp := new(apiv1.PodTemplate) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -1532,9 +1448,7 @@ func (w *CoreV1PodTemplateWatcher) Close() error { } func (c *CoreV1) WatchPodTemplates(ctx context.Context, namespace string, options ...Option) (*CoreV1PodTemplateWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "podtemplates", "", options...) + url := c.client.urlFor("", "v1", namespace, "podtemplates", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -1543,9 +1457,7 @@ func (c *CoreV1) WatchPodTemplates(ctx context.Context, namespace string, option } func (c *CoreV1) ListPodTemplates(ctx context.Context, namespace string, options ...Option) (*apiv1.PodTemplateList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "podtemplates", "", options...) + url := c.client.urlFor("", "v1", namespace, "podtemplates", "", options...) resp := new(apiv1.PodTemplateList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -1568,7 +1480,7 @@ func (c *CoreV1) CreatePodTemplateSpec(ctx context.Context, obj *apiv1.PodTempla } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -1597,7 +1509,7 @@ func (c *CoreV1) UpdatePodTemplateSpec(ctx context.Context, obj *apiv1.PodTempla } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -1615,9 +1527,7 @@ func (c *CoreV1) DeletePodTemplateSpec(ctx context.Context, name string, namespa if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "podtemplatespecs", name) + url := c.client.urlFor("", "v1", namespace, "podtemplatespecs", name) return c.client.delete(ctx, pbCodec, url) } @@ -1625,9 +1535,7 @@ func (c *CoreV1) GetPodTemplateSpec(ctx context.Context, name, namespace string) if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "podtemplatespecs", name) + url := c.client.urlFor("", "v1", namespace, "podtemplatespecs", name) resp := new(apiv1.PodTemplateSpec) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -1650,7 +1558,7 @@ func (c *CoreV1) CreateRangeAllocation(ctx context.Context, obj *apiv1.RangeAllo } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -1679,7 +1587,7 @@ func (c *CoreV1) UpdateRangeAllocation(ctx context.Context, obj *apiv1.RangeAllo } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -1697,9 +1605,7 @@ func (c *CoreV1) DeleteRangeAllocation(ctx context.Context, name string, namespa if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "rangeallocations", name) + url := c.client.urlFor("", "v1", namespace, "rangeallocations", name) return c.client.delete(ctx, pbCodec, url) } @@ -1707,9 +1613,7 @@ func (c *CoreV1) GetRangeAllocation(ctx context.Context, name, namespace string) if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "rangeallocations", name) + url := c.client.urlFor("", "v1", namespace, "rangeallocations", name) resp := new(apiv1.RangeAllocation) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -1732,7 +1636,7 @@ func (c *CoreV1) CreateReplicationController(ctx context.Context, obj *apiv1.Rep } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -1761,7 +1665,7 @@ func (c *CoreV1) UpdateReplicationController(ctx context.Context, obj *apiv1.Rep } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -1779,9 +1683,7 @@ func (c *CoreV1) DeleteReplicationController(ctx context.Context, name string, n if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "replicationcontrollers", name) + url := c.client.urlFor("", "v1", namespace, "replicationcontrollers", name) return c.client.delete(ctx, pbCodec, url) } @@ -1789,9 +1691,7 @@ func (c *CoreV1) GetReplicationController(ctx context.Context, name, namespace s if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "replicationcontrollers", name) + url := c.client.urlFor("", "v1", namespace, "replicationcontrollers", name) resp := new(apiv1.ReplicationController) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -1820,9 +1720,7 @@ func (w *CoreV1ReplicationControllerWatcher) Close() error { } func (c *CoreV1) WatchReplicationControllers(ctx context.Context, namespace string, options ...Option) (*CoreV1ReplicationControllerWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "replicationcontrollers", "", options...) + url := c.client.urlFor("", "v1", namespace, "replicationcontrollers", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -1831,9 +1729,7 @@ func (c *CoreV1) WatchReplicationControllers(ctx context.Context, namespace stri } func (c *CoreV1) ListReplicationControllers(ctx context.Context, namespace string, options ...Option) (*apiv1.ReplicationControllerList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "replicationcontrollers", "", options...) + url := c.client.urlFor("", "v1", namespace, "replicationcontrollers", "", options...) resp := new(apiv1.ReplicationControllerList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -1856,7 +1752,7 @@ func (c *CoreV1) CreateResourceQuota(ctx context.Context, obj *apiv1.ResourceQuo } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -1885,7 +1781,7 @@ func (c *CoreV1) UpdateResourceQuota(ctx context.Context, obj *apiv1.ResourceQuo } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -1903,9 +1799,7 @@ func (c *CoreV1) DeleteResourceQuota(ctx context.Context, name string, namespace if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "resourcequotas", name) + url := c.client.urlFor("", "v1", namespace, "resourcequotas", name) return c.client.delete(ctx, pbCodec, url) } @@ -1913,9 +1807,7 @@ func (c *CoreV1) GetResourceQuota(ctx context.Context, name, namespace string) ( if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "resourcequotas", name) + url := c.client.urlFor("", "v1", namespace, "resourcequotas", name) resp := new(apiv1.ResourceQuota) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -1944,9 +1836,7 @@ func (w *CoreV1ResourceQuotaWatcher) Close() error { } func (c *CoreV1) WatchResourceQuotas(ctx context.Context, namespace string, options ...Option) (*CoreV1ResourceQuotaWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "resourcequotas", "", options...) + url := c.client.urlFor("", "v1", namespace, "resourcequotas", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -1955,9 +1845,7 @@ func (c *CoreV1) WatchResourceQuotas(ctx context.Context, namespace string, opti } func (c *CoreV1) ListResourceQuotas(ctx context.Context, namespace string, options ...Option) (*apiv1.ResourceQuotaList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "resourcequotas", "", options...) + url := c.client.urlFor("", "v1", namespace, "resourcequotas", "", options...) resp := new(apiv1.ResourceQuotaList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -1980,7 +1868,7 @@ func (c *CoreV1) CreateSecret(ctx context.Context, obj *apiv1.Secret) (*apiv1.Se } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -2009,7 +1897,7 @@ func (c *CoreV1) UpdateSecret(ctx context.Context, obj *apiv1.Secret) (*apiv1.Se } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -2027,9 +1915,7 @@ func (c *CoreV1) DeleteSecret(ctx context.Context, name string, namespace string if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "secrets", name) + url := c.client.urlFor("", "v1", namespace, "secrets", name) return c.client.delete(ctx, pbCodec, url) } @@ -2037,9 +1923,7 @@ func (c *CoreV1) GetSecret(ctx context.Context, name, namespace string) (*apiv1. if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "secrets", name) + url := c.client.urlFor("", "v1", namespace, "secrets", name) resp := new(apiv1.Secret) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -2068,9 +1952,7 @@ func (w *CoreV1SecretWatcher) Close() error { } func (c *CoreV1) WatchSecrets(ctx context.Context, namespace string, options ...Option) (*CoreV1SecretWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "secrets", "", options...) + url := c.client.urlFor("", "v1", namespace, "secrets", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -2079,9 +1961,7 @@ func (c *CoreV1) WatchSecrets(ctx context.Context, namespace string, options ... } func (c *CoreV1) ListSecrets(ctx context.Context, namespace string, options ...Option) (*apiv1.SecretList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "secrets", "", options...) + url := c.client.urlFor("", "v1", namespace, "secrets", "", options...) resp := new(apiv1.SecretList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -2104,7 +1984,7 @@ func (c *CoreV1) CreateService(ctx context.Context, obj *apiv1.Service) (*apiv1. } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -2133,7 +2013,7 @@ func (c *CoreV1) UpdateService(ctx context.Context, obj *apiv1.Service) (*apiv1. } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -2151,9 +2031,7 @@ func (c *CoreV1) DeleteService(ctx context.Context, name string, namespace strin if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "services", name) + url := c.client.urlFor("", "v1", namespace, "services", name) return c.client.delete(ctx, pbCodec, url) } @@ -2161,9 +2039,7 @@ func (c *CoreV1) GetService(ctx context.Context, name, namespace string) (*apiv1 if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "services", name) + url := c.client.urlFor("", "v1", namespace, "services", name) resp := new(apiv1.Service) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -2192,9 +2068,7 @@ func (w *CoreV1ServiceWatcher) Close() error { } func (c *CoreV1) WatchServices(ctx context.Context, namespace string, options ...Option) (*CoreV1ServiceWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "services", "", options...) + url := c.client.urlFor("", "v1", namespace, "services", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -2203,9 +2077,7 @@ func (c *CoreV1) WatchServices(ctx context.Context, namespace string, options .. } func (c *CoreV1) ListServices(ctx context.Context, namespace string, options ...Option) (*apiv1.ServiceList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "services", "", options...) + url := c.client.urlFor("", "v1", namespace, "services", "", options...) resp := new(apiv1.ServiceList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -2228,7 +2100,7 @@ func (c *CoreV1) CreateServiceAccount(ctx context.Context, obj *apiv1.ServiceAcc } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -2257,7 +2129,7 @@ func (c *CoreV1) UpdateServiceAccount(ctx context.Context, obj *apiv1.ServiceAcc } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -2275,9 +2147,7 @@ func (c *CoreV1) DeleteServiceAccount(ctx context.Context, name string, namespac if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "serviceaccounts", name) + url := c.client.urlFor("", "v1", namespace, "serviceaccounts", name) return c.client.delete(ctx, pbCodec, url) } @@ -2285,9 +2155,7 @@ func (c *CoreV1) GetServiceAccount(ctx context.Context, name, namespace string) if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "serviceaccounts", name) + url := c.client.urlFor("", "v1", namespace, "serviceaccounts", name) resp := new(apiv1.ServiceAccount) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -2316,9 +2184,7 @@ func (w *CoreV1ServiceAccountWatcher) Close() error { } func (c *CoreV1) WatchServiceAccounts(ctx context.Context, namespace string, options ...Option) (*CoreV1ServiceAccountWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "serviceaccounts", "", options...) + url := c.client.urlFor("", "v1", namespace, "serviceaccounts", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -2327,9 +2193,7 @@ func (c *CoreV1) WatchServiceAccounts(ctx context.Context, namespace string, opt } func (c *CoreV1) ListServiceAccounts(ctx context.Context, namespace string, options ...Option) (*apiv1.ServiceAccountList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("", "v1", ns, "serviceaccounts", "", options...) + url := c.client.urlFor("", "v1", namespace, "serviceaccounts", "", options...) resp := new(apiv1.ServiceAccountList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -2363,7 +2227,7 @@ func (c *AppsV1Alpha1) CreatePetSet(ctx context.Context, obj *appsv1alpha1.PetSe } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -2392,7 +2256,7 @@ func (c *AppsV1Alpha1) UpdatePetSet(ctx context.Context, obj *appsv1alpha1.PetSe } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -2410,9 +2274,7 @@ func (c *AppsV1Alpha1) DeletePetSet(ctx context.Context, name string, namespace if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("apps", "v1alpha1", ns, "petsets", name) + url := c.client.urlFor("apps", "v1alpha1", namespace, "petsets", name) return c.client.delete(ctx, pbCodec, url) } @@ -2420,9 +2282,7 @@ func (c *AppsV1Alpha1) GetPetSet(ctx context.Context, name, namespace string) (* if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("apps", "v1alpha1", ns, "petsets", name) + url := c.client.urlFor("apps", "v1alpha1", namespace, "petsets", name) resp := new(appsv1alpha1.PetSet) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -2451,9 +2311,7 @@ func (w *AppsV1Alpha1PetSetWatcher) Close() error { } func (c *AppsV1Alpha1) WatchPetSets(ctx context.Context, namespace string, options ...Option) (*AppsV1Alpha1PetSetWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("apps", "v1alpha1", ns, "petsets", "", options...) + url := c.client.urlFor("apps", "v1alpha1", namespace, "petsets", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -2462,9 +2320,7 @@ func (c *AppsV1Alpha1) WatchPetSets(ctx context.Context, namespace string, optio } func (c *AppsV1Alpha1) ListPetSets(ctx context.Context, namespace string, options ...Option) (*appsv1alpha1.PetSetList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("apps", "v1alpha1", ns, "petsets", "", options...) + url := c.client.urlFor("apps", "v1alpha1", namespace, "petsets", "", options...) resp := new(appsv1alpha1.PetSetList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -2498,7 +2354,7 @@ func (c *AppsV1Beta1) CreateStatefulSet(ctx context.Context, obj *appsv1beta1.St } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -2527,7 +2383,7 @@ func (c *AppsV1Beta1) UpdateStatefulSet(ctx context.Context, obj *appsv1beta1.St } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -2545,9 +2401,7 @@ func (c *AppsV1Beta1) DeleteStatefulSet(ctx context.Context, name string, namesp if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("apps", "v1beta1", ns, "statefulsets", name) + url := c.client.urlFor("apps", "v1beta1", namespace, "statefulsets", name) return c.client.delete(ctx, pbCodec, url) } @@ -2555,9 +2409,7 @@ func (c *AppsV1Beta1) GetStatefulSet(ctx context.Context, name, namespace string if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("apps", "v1beta1", ns, "statefulsets", name) + url := c.client.urlFor("apps", "v1beta1", namespace, "statefulsets", name) resp := new(appsv1beta1.StatefulSet) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -2586,9 +2438,7 @@ func (w *AppsV1Beta1StatefulSetWatcher) Close() error { } func (c *AppsV1Beta1) WatchStatefulSets(ctx context.Context, namespace string, options ...Option) (*AppsV1Beta1StatefulSetWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("apps", "v1beta1", ns, "statefulsets", "", options...) + url := c.client.urlFor("apps", "v1beta1", namespace, "statefulsets", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -2597,9 +2447,7 @@ func (c *AppsV1Beta1) WatchStatefulSets(ctx context.Context, namespace string, o } func (c *AppsV1Beta1) ListStatefulSets(ctx context.Context, namespace string, options ...Option) (*appsv1beta1.StatefulSetList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("apps", "v1beta1", ns, "statefulsets", "", options...) + url := c.client.urlFor("apps", "v1beta1", namespace, "statefulsets", "", options...) resp := new(appsv1beta1.StatefulSetList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -2633,7 +2481,7 @@ func (c *AuthenticationV1Beta1) CreateTokenReview(ctx context.Context, obj *auth } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -2662,7 +2510,7 @@ func (c *AuthenticationV1Beta1) UpdateTokenReview(ctx context.Context, obj *auth } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -2680,9 +2528,7 @@ func (c *AuthenticationV1Beta1) DeleteTokenReview(ctx context.Context, name stri if name == "" { return fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("authentication.k8s.io", "v1beta1", ns, "tokenreviews", name) + url := c.client.urlFor("authentication.k8s.io", "v1beta1", AllNamespaces, "tokenreviews", name) return c.client.delete(ctx, pbCodec, url) } @@ -2690,9 +2536,7 @@ func (c *AuthenticationV1Beta1) GetTokenReview(ctx context.Context, name string) if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("authentication.k8s.io", "v1beta1", ns, "tokenreviews", name) + url := c.client.urlFor("authentication.k8s.io", "v1beta1", AllNamespaces, "tokenreviews", name) resp := new(authenticationv1beta1.TokenReview) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -2726,7 +2570,7 @@ func (c *AuthorizationV1Beta1) CreateLocalSubjectAccessReview(ctx context.Contex } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -2755,7 +2599,7 @@ func (c *AuthorizationV1Beta1) UpdateLocalSubjectAccessReview(ctx context.Contex } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -2773,9 +2617,7 @@ func (c *AuthorizationV1Beta1) DeleteLocalSubjectAccessReview(ctx context.Contex if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("authorization.k8s.io", "v1beta1", ns, "localsubjectaccessreviews", name) + url := c.client.urlFor("authorization.k8s.io", "v1beta1", namespace, "localsubjectaccessreviews", name) return c.client.delete(ctx, pbCodec, url) } @@ -2783,9 +2625,7 @@ func (c *AuthorizationV1Beta1) GetLocalSubjectAccessReview(ctx context.Context, if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("authorization.k8s.io", "v1beta1", ns, "localsubjectaccessreviews", name) + url := c.client.urlFor("authorization.k8s.io", "v1beta1", namespace, "localsubjectaccessreviews", name) resp := new(authorizationv1beta1.LocalSubjectAccessReview) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -2808,7 +2648,7 @@ func (c *AuthorizationV1Beta1) CreateSelfSubjectAccessReview(ctx context.Context } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -2837,7 +2677,7 @@ func (c *AuthorizationV1Beta1) UpdateSelfSubjectAccessReview(ctx context.Context } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -2855,9 +2695,7 @@ func (c *AuthorizationV1Beta1) DeleteSelfSubjectAccessReview(ctx context.Context if name == "" { return fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("authorization.k8s.io", "v1beta1", ns, "selfsubjectaccessreviews", name) + url := c.client.urlFor("authorization.k8s.io", "v1beta1", AllNamespaces, "selfsubjectaccessreviews", name) return c.client.delete(ctx, pbCodec, url) } @@ -2865,9 +2703,7 @@ func (c *AuthorizationV1Beta1) GetSelfSubjectAccessReview(ctx context.Context, n if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("authorization.k8s.io", "v1beta1", ns, "selfsubjectaccessreviews", name) + url := c.client.urlFor("authorization.k8s.io", "v1beta1", AllNamespaces, "selfsubjectaccessreviews", name) resp := new(authorizationv1beta1.SelfSubjectAccessReview) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -2890,7 +2726,7 @@ func (c *AuthorizationV1Beta1) CreateSubjectAccessReview(ctx context.Context, ob } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -2919,7 +2755,7 @@ func (c *AuthorizationV1Beta1) UpdateSubjectAccessReview(ctx context.Context, ob } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -2937,9 +2773,7 @@ func (c *AuthorizationV1Beta1) DeleteSubjectAccessReview(ctx context.Context, na if name == "" { return fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("authorization.k8s.io", "v1beta1", ns, "subjectaccessreviews", name) + url := c.client.urlFor("authorization.k8s.io", "v1beta1", AllNamespaces, "subjectaccessreviews", name) return c.client.delete(ctx, pbCodec, url) } @@ -2947,9 +2781,7 @@ func (c *AuthorizationV1Beta1) GetSubjectAccessReview(ctx context.Context, name if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("authorization.k8s.io", "v1beta1", ns, "subjectaccessreviews", name) + url := c.client.urlFor("authorization.k8s.io", "v1beta1", AllNamespaces, "subjectaccessreviews", name) resp := new(authorizationv1beta1.SubjectAccessReview) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -2983,7 +2815,7 @@ func (c *AutoscalingV1) CreateHorizontalPodAutoscaler(ctx context.Context, obj * } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -3012,7 +2844,7 @@ func (c *AutoscalingV1) UpdateHorizontalPodAutoscaler(ctx context.Context, obj * } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -3030,9 +2862,7 @@ func (c *AutoscalingV1) DeleteHorizontalPodAutoscaler(ctx context.Context, name if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("autoscaling", "v1", ns, "horizontalpodautoscalers", name) + url := c.client.urlFor("autoscaling", "v1", namespace, "horizontalpodautoscalers", name) return c.client.delete(ctx, pbCodec, url) } @@ -3040,9 +2870,7 @@ func (c *AutoscalingV1) GetHorizontalPodAutoscaler(ctx context.Context, name, na if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("autoscaling", "v1", ns, "horizontalpodautoscalers", name) + url := c.client.urlFor("autoscaling", "v1", namespace, "horizontalpodautoscalers", name) resp := new(autoscalingv1.HorizontalPodAutoscaler) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -3071,9 +2899,7 @@ func (w *AutoscalingV1HorizontalPodAutoscalerWatcher) Close() error { } func (c *AutoscalingV1) WatchHorizontalPodAutoscalers(ctx context.Context, namespace string, options ...Option) (*AutoscalingV1HorizontalPodAutoscalerWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("autoscaling", "v1", ns, "horizontalpodautoscalers", "", options...) + url := c.client.urlFor("autoscaling", "v1", namespace, "horizontalpodautoscalers", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -3082,9 +2908,7 @@ func (c *AutoscalingV1) WatchHorizontalPodAutoscalers(ctx context.Context, names } func (c *AutoscalingV1) ListHorizontalPodAutoscalers(ctx context.Context, namespace string, options ...Option) (*autoscalingv1.HorizontalPodAutoscalerList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("autoscaling", "v1", ns, "horizontalpodautoscalers", "", options...) + url := c.client.urlFor("autoscaling", "v1", namespace, "horizontalpodautoscalers", "", options...) resp := new(autoscalingv1.HorizontalPodAutoscalerList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -3107,7 +2931,7 @@ func (c *AutoscalingV1) CreateScale(ctx context.Context, obj *autoscalingv1.Scal } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -3136,7 +2960,7 @@ func (c *AutoscalingV1) UpdateScale(ctx context.Context, obj *autoscalingv1.Scal } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -3154,9 +2978,7 @@ func (c *AutoscalingV1) DeleteScale(ctx context.Context, name string, namespace if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("autoscaling", "v1", ns, "scales", name) + url := c.client.urlFor("autoscaling", "v1", namespace, "scales", name) return c.client.delete(ctx, pbCodec, url) } @@ -3164,9 +2986,7 @@ func (c *AutoscalingV1) GetScale(ctx context.Context, name, namespace string) (* if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("autoscaling", "v1", ns, "scales", name) + url := c.client.urlFor("autoscaling", "v1", namespace, "scales", name) resp := new(autoscalingv1.Scale) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -3200,7 +3020,7 @@ func (c *BatchV1) CreateJob(ctx context.Context, obj *batchv1.Job) (*batchv1.Job } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -3229,7 +3049,7 @@ func (c *BatchV1) UpdateJob(ctx context.Context, obj *batchv1.Job) (*batchv1.Job } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -3247,9 +3067,7 @@ func (c *BatchV1) DeleteJob(ctx context.Context, name string, namespace string) if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("batch", "v1", ns, "jobs", name) + url := c.client.urlFor("batch", "v1", namespace, "jobs", name) return c.client.delete(ctx, pbCodec, url) } @@ -3257,9 +3075,7 @@ func (c *BatchV1) GetJob(ctx context.Context, name, namespace string) (*batchv1. if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("batch", "v1", ns, "jobs", name) + url := c.client.urlFor("batch", "v1", namespace, "jobs", name) resp := new(batchv1.Job) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -3288,9 +3104,7 @@ func (w *BatchV1JobWatcher) Close() error { } func (c *BatchV1) WatchJobs(ctx context.Context, namespace string, options ...Option) (*BatchV1JobWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("batch", "v1", ns, "jobs", "", options...) + url := c.client.urlFor("batch", "v1", namespace, "jobs", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -3299,9 +3113,7 @@ func (c *BatchV1) WatchJobs(ctx context.Context, namespace string, options ...Op } func (c *BatchV1) ListJobs(ctx context.Context, namespace string, options ...Option) (*batchv1.JobList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("batch", "v1", ns, "jobs", "", options...) + url := c.client.urlFor("batch", "v1", namespace, "jobs", "", options...) resp := new(batchv1.JobList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -3335,7 +3147,7 @@ func (c *BatchV2Alpha1) CreateCronJob(ctx context.Context, obj *batchv2alpha1.Cr } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -3364,7 +3176,7 @@ func (c *BatchV2Alpha1) UpdateCronJob(ctx context.Context, obj *batchv2alpha1.Cr } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -3382,9 +3194,7 @@ func (c *BatchV2Alpha1) DeleteCronJob(ctx context.Context, name string, namespac if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("batch", "v2alpha1", ns, "cronjobs", name) + url := c.client.urlFor("batch", "v2alpha1", namespace, "cronjobs", name) return c.client.delete(ctx, pbCodec, url) } @@ -3392,9 +3202,7 @@ func (c *BatchV2Alpha1) GetCronJob(ctx context.Context, name, namespace string) if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("batch", "v2alpha1", ns, "cronjobs", name) + url := c.client.urlFor("batch", "v2alpha1", namespace, "cronjobs", name) resp := new(batchv2alpha1.CronJob) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -3423,9 +3231,7 @@ func (w *BatchV2Alpha1CronJobWatcher) Close() error { } func (c *BatchV2Alpha1) WatchCronJobs(ctx context.Context, namespace string, options ...Option) (*BatchV2Alpha1CronJobWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("batch", "v2alpha1", ns, "cronjobs", "", options...) + url := c.client.urlFor("batch", "v2alpha1", namespace, "cronjobs", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -3434,9 +3240,7 @@ func (c *BatchV2Alpha1) WatchCronJobs(ctx context.Context, namespace string, opt } func (c *BatchV2Alpha1) ListCronJobs(ctx context.Context, namespace string, options ...Option) (*batchv2alpha1.CronJobList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("batch", "v2alpha1", ns, "cronjobs", "", options...) + url := c.client.urlFor("batch", "v2alpha1", namespace, "cronjobs", "", options...) resp := new(batchv2alpha1.CronJobList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -3459,7 +3263,7 @@ func (c *BatchV2Alpha1) CreateJob(ctx context.Context, obj *batchv2alpha1.Job) ( } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -3488,7 +3292,7 @@ func (c *BatchV2Alpha1) UpdateJob(ctx context.Context, obj *batchv2alpha1.Job) ( } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -3506,9 +3310,7 @@ func (c *BatchV2Alpha1) DeleteJob(ctx context.Context, name string, namespace st if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("batch", "v2alpha1", ns, "jobs", name) + url := c.client.urlFor("batch", "v2alpha1", namespace, "jobs", name) return c.client.delete(ctx, pbCodec, url) } @@ -3516,9 +3318,7 @@ func (c *BatchV2Alpha1) GetJob(ctx context.Context, name, namespace string) (*ba if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("batch", "v2alpha1", ns, "jobs", name) + url := c.client.urlFor("batch", "v2alpha1", namespace, "jobs", name) resp := new(batchv2alpha1.Job) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -3547,9 +3347,7 @@ func (w *BatchV2Alpha1JobWatcher) Close() error { } func (c *BatchV2Alpha1) WatchJobs(ctx context.Context, namespace string, options ...Option) (*BatchV2Alpha1JobWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("batch", "v2alpha1", ns, "jobs", "", options...) + url := c.client.urlFor("batch", "v2alpha1", namespace, "jobs", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -3558,9 +3356,7 @@ func (c *BatchV2Alpha1) WatchJobs(ctx context.Context, namespace string, options } func (c *BatchV2Alpha1) ListJobs(ctx context.Context, namespace string, options ...Option) (*batchv2alpha1.JobList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("batch", "v2alpha1", ns, "jobs", "", options...) + url := c.client.urlFor("batch", "v2alpha1", namespace, "jobs", "", options...) resp := new(batchv2alpha1.JobList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -3583,7 +3379,7 @@ func (c *BatchV2Alpha1) CreateJobTemplate(ctx context.Context, obj *batchv2alpha } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -3612,7 +3408,7 @@ func (c *BatchV2Alpha1) UpdateJobTemplate(ctx context.Context, obj *batchv2alpha } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -3630,9 +3426,7 @@ func (c *BatchV2Alpha1) DeleteJobTemplate(ctx context.Context, name string, name if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("batch", "v2alpha1", ns, "jobtemplates", name) + url := c.client.urlFor("batch", "v2alpha1", namespace, "jobtemplates", name) return c.client.delete(ctx, pbCodec, url) } @@ -3640,9 +3434,7 @@ func (c *BatchV2Alpha1) GetJobTemplate(ctx context.Context, name, namespace stri if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("batch", "v2alpha1", ns, "jobtemplates", name) + url := c.client.urlFor("batch", "v2alpha1", namespace, "jobtemplates", name) resp := new(batchv2alpha1.JobTemplate) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -3676,7 +3468,7 @@ func (c *CertificatesV1Alpha1) CreateCertificateSigningRequest(ctx context.Conte } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -3705,7 +3497,7 @@ func (c *CertificatesV1Alpha1) UpdateCertificateSigningRequest(ctx context.Conte } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -3723,9 +3515,7 @@ func (c *CertificatesV1Alpha1) DeleteCertificateSigningRequest(ctx context.Conte if name == "" { return fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("certificates.k8s.io", "v1alpha1", ns, "certificatesigningrequests", name) + url := c.client.urlFor("certificates.k8s.io", "v1alpha1", AllNamespaces, "certificatesigningrequests", name) return c.client.delete(ctx, pbCodec, url) } @@ -3733,9 +3523,7 @@ func (c *CertificatesV1Alpha1) GetCertificateSigningRequest(ctx context.Context, if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("certificates.k8s.io", "v1alpha1", ns, "certificatesigningrequests", name) + url := c.client.urlFor("certificates.k8s.io", "v1alpha1", AllNamespaces, "certificatesigningrequests", name) resp := new(certificatesv1alpha1.CertificateSigningRequest) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -3764,8 +3552,7 @@ func (w *CertificatesV1Alpha1CertificateSigningRequestWatcher) Close() error { } func (c *CertificatesV1Alpha1) WatchCertificateSigningRequests(ctx context.Context, options ...Option) (*CertificatesV1Alpha1CertificateSigningRequestWatcher, error) { - ns := "" - url := c.client.urlFor("certificates.k8s.io", "v1alpha1", ns, "certificatesigningrequests", "", options...) + url := c.client.urlFor("certificates.k8s.io", "v1alpha1", AllNamespaces, "certificatesigningrequests", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -3774,8 +3561,7 @@ func (c *CertificatesV1Alpha1) WatchCertificateSigningRequests(ctx context.Conte } func (c *CertificatesV1Alpha1) ListCertificateSigningRequests(ctx context.Context, options ...Option) (*certificatesv1alpha1.CertificateSigningRequestList, error) { - ns := "" - url := c.client.urlFor("certificates.k8s.io", "v1alpha1", ns, "certificatesigningrequests", "", options...) + url := c.client.urlFor("certificates.k8s.io", "v1alpha1", AllNamespaces, "certificatesigningrequests", "", options...) resp := new(certificatesv1alpha1.CertificateSigningRequestList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -3809,7 +3595,7 @@ func (c *ExtensionsV1Beta1) CreateDaemonSet(ctx context.Context, obj *extensions } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -3838,7 +3624,7 @@ func (c *ExtensionsV1Beta1) UpdateDaemonSet(ctx context.Context, obj *extensions } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -3856,9 +3642,7 @@ func (c *ExtensionsV1Beta1) DeleteDaemonSet(ctx context.Context, name string, na if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "daemonsets", name) + url := c.client.urlFor("extensions", "v1beta1", namespace, "daemonsets", name) return c.client.delete(ctx, pbCodec, url) } @@ -3866,9 +3650,7 @@ func (c *ExtensionsV1Beta1) GetDaemonSet(ctx context.Context, name, namespace st if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "daemonsets", name) + url := c.client.urlFor("extensions", "v1beta1", namespace, "daemonsets", name) resp := new(extensionsv1beta1.DaemonSet) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -3897,9 +3679,7 @@ func (w *ExtensionsV1Beta1DaemonSetWatcher) Close() error { } func (c *ExtensionsV1Beta1) WatchDaemonSets(ctx context.Context, namespace string, options ...Option) (*ExtensionsV1Beta1DaemonSetWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "daemonsets", "", options...) + url := c.client.urlFor("extensions", "v1beta1", namespace, "daemonsets", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -3908,9 +3688,7 @@ func (c *ExtensionsV1Beta1) WatchDaemonSets(ctx context.Context, namespace strin } func (c *ExtensionsV1Beta1) ListDaemonSets(ctx context.Context, namespace string, options ...Option) (*extensionsv1beta1.DaemonSetList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "daemonsets", "", options...) + url := c.client.urlFor("extensions", "v1beta1", namespace, "daemonsets", "", options...) resp := new(extensionsv1beta1.DaemonSetList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -3933,7 +3711,7 @@ func (c *ExtensionsV1Beta1) CreateDeployment(ctx context.Context, obj *extension } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -3962,7 +3740,7 @@ func (c *ExtensionsV1Beta1) UpdateDeployment(ctx context.Context, obj *extension } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -3980,9 +3758,7 @@ func (c *ExtensionsV1Beta1) DeleteDeployment(ctx context.Context, name string, n if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "deployments", name) + url := c.client.urlFor("extensions", "v1beta1", namespace, "deployments", name) return c.client.delete(ctx, pbCodec, url) } @@ -3990,9 +3766,7 @@ func (c *ExtensionsV1Beta1) GetDeployment(ctx context.Context, name, namespace s if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "deployments", name) + url := c.client.urlFor("extensions", "v1beta1", namespace, "deployments", name) resp := new(extensionsv1beta1.Deployment) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -4021,9 +3795,7 @@ func (w *ExtensionsV1Beta1DeploymentWatcher) Close() error { } func (c *ExtensionsV1Beta1) WatchDeployments(ctx context.Context, namespace string, options ...Option) (*ExtensionsV1Beta1DeploymentWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "deployments", "", options...) + url := c.client.urlFor("extensions", "v1beta1", namespace, "deployments", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -4032,9 +3804,7 @@ func (c *ExtensionsV1Beta1) WatchDeployments(ctx context.Context, namespace stri } func (c *ExtensionsV1Beta1) ListDeployments(ctx context.Context, namespace string, options ...Option) (*extensionsv1beta1.DeploymentList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "deployments", "", options...) + url := c.client.urlFor("extensions", "v1beta1", namespace, "deployments", "", options...) resp := new(extensionsv1beta1.DeploymentList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -4057,7 +3827,7 @@ func (c *ExtensionsV1Beta1) CreateHorizontalPodAutoscaler(ctx context.Context, o } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -4086,7 +3856,7 @@ func (c *ExtensionsV1Beta1) UpdateHorizontalPodAutoscaler(ctx context.Context, o } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -4104,9 +3874,7 @@ func (c *ExtensionsV1Beta1) DeleteHorizontalPodAutoscaler(ctx context.Context, n if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "horizontalpodautoscalers", name) + url := c.client.urlFor("extensions", "v1beta1", namespace, "horizontalpodautoscalers", name) return c.client.delete(ctx, pbCodec, url) } @@ -4114,9 +3882,7 @@ func (c *ExtensionsV1Beta1) GetHorizontalPodAutoscaler(ctx context.Context, name if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "horizontalpodautoscalers", name) + url := c.client.urlFor("extensions", "v1beta1", namespace, "horizontalpodautoscalers", name) resp := new(extensionsv1beta1.HorizontalPodAutoscaler) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -4145,9 +3911,7 @@ func (w *ExtensionsV1Beta1HorizontalPodAutoscalerWatcher) Close() error { } func (c *ExtensionsV1Beta1) WatchHorizontalPodAutoscalers(ctx context.Context, namespace string, options ...Option) (*ExtensionsV1Beta1HorizontalPodAutoscalerWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "horizontalpodautoscalers", "", options...) + url := c.client.urlFor("extensions", "v1beta1", namespace, "horizontalpodautoscalers", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -4156,9 +3920,7 @@ func (c *ExtensionsV1Beta1) WatchHorizontalPodAutoscalers(ctx context.Context, n } func (c *ExtensionsV1Beta1) ListHorizontalPodAutoscalers(ctx context.Context, namespace string, options ...Option) (*extensionsv1beta1.HorizontalPodAutoscalerList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "horizontalpodautoscalers", "", options...) + url := c.client.urlFor("extensions", "v1beta1", namespace, "horizontalpodautoscalers", "", options...) resp := new(extensionsv1beta1.HorizontalPodAutoscalerList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -4181,7 +3943,7 @@ func (c *ExtensionsV1Beta1) CreateIngress(ctx context.Context, obj *extensionsv1 } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -4210,7 +3972,7 @@ func (c *ExtensionsV1Beta1) UpdateIngress(ctx context.Context, obj *extensionsv1 } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -4228,9 +3990,7 @@ func (c *ExtensionsV1Beta1) DeleteIngress(ctx context.Context, name string, name if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "ingresses", name) + url := c.client.urlFor("extensions", "v1beta1", namespace, "ingresses", name) return c.client.delete(ctx, pbCodec, url) } @@ -4238,9 +3998,7 @@ func (c *ExtensionsV1Beta1) GetIngress(ctx context.Context, name, namespace stri if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "ingresses", name) + url := c.client.urlFor("extensions", "v1beta1", namespace, "ingresses", name) resp := new(extensionsv1beta1.Ingress) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -4269,9 +4027,7 @@ func (w *ExtensionsV1Beta1IngressWatcher) Close() error { } func (c *ExtensionsV1Beta1) WatchIngresses(ctx context.Context, namespace string, options ...Option) (*ExtensionsV1Beta1IngressWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "ingresses", "", options...) + url := c.client.urlFor("extensions", "v1beta1", namespace, "ingresses", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -4280,9 +4036,7 @@ func (c *ExtensionsV1Beta1) WatchIngresses(ctx context.Context, namespace string } func (c *ExtensionsV1Beta1) ListIngresses(ctx context.Context, namespace string, options ...Option) (*extensionsv1beta1.IngressList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "ingresses", "", options...) + url := c.client.urlFor("extensions", "v1beta1", namespace, "ingresses", "", options...) resp := new(extensionsv1beta1.IngressList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -4305,7 +4059,7 @@ func (c *ExtensionsV1Beta1) CreateJob(ctx context.Context, obj *extensionsv1beta } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -4334,7 +4088,7 @@ func (c *ExtensionsV1Beta1) UpdateJob(ctx context.Context, obj *extensionsv1beta } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -4352,9 +4106,7 @@ func (c *ExtensionsV1Beta1) DeleteJob(ctx context.Context, name string, namespac if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "jobs", name) + url := c.client.urlFor("extensions", "v1beta1", namespace, "jobs", name) return c.client.delete(ctx, pbCodec, url) } @@ -4362,9 +4114,7 @@ func (c *ExtensionsV1Beta1) GetJob(ctx context.Context, name, namespace string) if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "jobs", name) + url := c.client.urlFor("extensions", "v1beta1", namespace, "jobs", name) resp := new(extensionsv1beta1.Job) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -4393,9 +4143,7 @@ func (w *ExtensionsV1Beta1JobWatcher) Close() error { } func (c *ExtensionsV1Beta1) WatchJobs(ctx context.Context, namespace string, options ...Option) (*ExtensionsV1Beta1JobWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "jobs", "", options...) + url := c.client.urlFor("extensions", "v1beta1", namespace, "jobs", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -4404,9 +4152,7 @@ func (c *ExtensionsV1Beta1) WatchJobs(ctx context.Context, namespace string, opt } func (c *ExtensionsV1Beta1) ListJobs(ctx context.Context, namespace string, options ...Option) (*extensionsv1beta1.JobList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "jobs", "", options...) + url := c.client.urlFor("extensions", "v1beta1", namespace, "jobs", "", options...) resp := new(extensionsv1beta1.JobList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -4429,7 +4175,7 @@ func (c *ExtensionsV1Beta1) CreateNetworkPolicy(ctx context.Context, obj *extens } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -4458,7 +4204,7 @@ func (c *ExtensionsV1Beta1) UpdateNetworkPolicy(ctx context.Context, obj *extens } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -4476,9 +4222,7 @@ func (c *ExtensionsV1Beta1) DeleteNetworkPolicy(ctx context.Context, name string if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "networkpolicies", name) + url := c.client.urlFor("extensions", "v1beta1", namespace, "networkpolicies", name) return c.client.delete(ctx, pbCodec, url) } @@ -4486,9 +4230,7 @@ func (c *ExtensionsV1Beta1) GetNetworkPolicy(ctx context.Context, name, namespac if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "networkpolicies", name) + url := c.client.urlFor("extensions", "v1beta1", namespace, "networkpolicies", name) resp := new(extensionsv1beta1.NetworkPolicy) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -4517,9 +4259,7 @@ func (w *ExtensionsV1Beta1NetworkPolicyWatcher) Close() error { } func (c *ExtensionsV1Beta1) WatchNetworkPolicies(ctx context.Context, namespace string, options ...Option) (*ExtensionsV1Beta1NetworkPolicyWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "networkpolicies", "", options...) + url := c.client.urlFor("extensions", "v1beta1", namespace, "networkpolicies", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -4528,9 +4268,7 @@ func (c *ExtensionsV1Beta1) WatchNetworkPolicies(ctx context.Context, namespace } func (c *ExtensionsV1Beta1) ListNetworkPolicies(ctx context.Context, namespace string, options ...Option) (*extensionsv1beta1.NetworkPolicyList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "networkpolicies", "", options...) + url := c.client.urlFor("extensions", "v1beta1", namespace, "networkpolicies", "", options...) resp := new(extensionsv1beta1.NetworkPolicyList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -4553,7 +4291,7 @@ func (c *ExtensionsV1Beta1) CreatePodSecurityPolicy(ctx context.Context, obj *ex } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -4582,7 +4320,7 @@ func (c *ExtensionsV1Beta1) UpdatePodSecurityPolicy(ctx context.Context, obj *ex } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -4600,9 +4338,7 @@ func (c *ExtensionsV1Beta1) DeletePodSecurityPolicy(ctx context.Context, name st if name == "" { return fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("extensions", "v1beta1", ns, "podsecuritypolicies", name) + url := c.client.urlFor("extensions", "v1beta1", AllNamespaces, "podsecuritypolicies", name) return c.client.delete(ctx, pbCodec, url) } @@ -4610,9 +4346,7 @@ func (c *ExtensionsV1Beta1) GetPodSecurityPolicy(ctx context.Context, name strin if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("extensions", "v1beta1", ns, "podsecuritypolicies", name) + url := c.client.urlFor("extensions", "v1beta1", AllNamespaces, "podsecuritypolicies", name) resp := new(extensionsv1beta1.PodSecurityPolicy) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -4641,8 +4375,7 @@ func (w *ExtensionsV1Beta1PodSecurityPolicyWatcher) Close() error { } func (c *ExtensionsV1Beta1) WatchPodSecurityPolicies(ctx context.Context, options ...Option) (*ExtensionsV1Beta1PodSecurityPolicyWatcher, error) { - ns := "" - url := c.client.urlFor("extensions", "v1beta1", ns, "podsecuritypolicies", "", options...) + url := c.client.urlFor("extensions", "v1beta1", AllNamespaces, "podsecuritypolicies", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -4651,8 +4384,7 @@ func (c *ExtensionsV1Beta1) WatchPodSecurityPolicies(ctx context.Context, option } func (c *ExtensionsV1Beta1) ListPodSecurityPolicies(ctx context.Context, options ...Option) (*extensionsv1beta1.PodSecurityPolicyList, error) { - ns := "" - url := c.client.urlFor("extensions", "v1beta1", ns, "podsecuritypolicies", "", options...) + url := c.client.urlFor("extensions", "v1beta1", AllNamespaces, "podsecuritypolicies", "", options...) resp := new(extensionsv1beta1.PodSecurityPolicyList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -4675,7 +4407,7 @@ func (c *ExtensionsV1Beta1) CreateReplicaSet(ctx context.Context, obj *extension } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -4704,7 +4436,7 @@ func (c *ExtensionsV1Beta1) UpdateReplicaSet(ctx context.Context, obj *extension } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -4722,9 +4454,7 @@ func (c *ExtensionsV1Beta1) DeleteReplicaSet(ctx context.Context, name string, n if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "replicasets", name) + url := c.client.urlFor("extensions", "v1beta1", namespace, "replicasets", name) return c.client.delete(ctx, pbCodec, url) } @@ -4732,9 +4462,7 @@ func (c *ExtensionsV1Beta1) GetReplicaSet(ctx context.Context, name, namespace s if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "replicasets", name) + url := c.client.urlFor("extensions", "v1beta1", namespace, "replicasets", name) resp := new(extensionsv1beta1.ReplicaSet) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -4763,9 +4491,7 @@ func (w *ExtensionsV1Beta1ReplicaSetWatcher) Close() error { } func (c *ExtensionsV1Beta1) WatchReplicaSets(ctx context.Context, namespace string, options ...Option) (*ExtensionsV1Beta1ReplicaSetWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "replicasets", "", options...) + url := c.client.urlFor("extensions", "v1beta1", namespace, "replicasets", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -4774,9 +4500,7 @@ func (c *ExtensionsV1Beta1) WatchReplicaSets(ctx context.Context, namespace stri } func (c *ExtensionsV1Beta1) ListReplicaSets(ctx context.Context, namespace string, options ...Option) (*extensionsv1beta1.ReplicaSetList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "replicasets", "", options...) + url := c.client.urlFor("extensions", "v1beta1", namespace, "replicasets", "", options...) resp := new(extensionsv1beta1.ReplicaSetList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -4799,7 +4523,7 @@ func (c *ExtensionsV1Beta1) CreateScale(ctx context.Context, obj *extensionsv1be } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -4828,7 +4552,7 @@ func (c *ExtensionsV1Beta1) UpdateScale(ctx context.Context, obj *extensionsv1be } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -4846,9 +4570,7 @@ func (c *ExtensionsV1Beta1) DeleteScale(ctx context.Context, name string, namesp if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "scales", name) + url := c.client.urlFor("extensions", "v1beta1", namespace, "scales", name) return c.client.delete(ctx, pbCodec, url) } @@ -4856,9 +4578,7 @@ func (c *ExtensionsV1Beta1) GetScale(ctx context.Context, name, namespace string if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "scales", name) + url := c.client.urlFor("extensions", "v1beta1", namespace, "scales", name) resp := new(extensionsv1beta1.Scale) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -4881,7 +4601,7 @@ func (c *ExtensionsV1Beta1) CreateThirdPartyResource(ctx context.Context, obj *e } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -4910,7 +4630,7 @@ func (c *ExtensionsV1Beta1) UpdateThirdPartyResource(ctx context.Context, obj *e } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -4928,9 +4648,7 @@ func (c *ExtensionsV1Beta1) DeleteThirdPartyResource(ctx context.Context, name s if name == "" { return fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("extensions", "v1beta1", ns, "thirdpartyresources", name) + url := c.client.urlFor("extensions", "v1beta1", AllNamespaces, "thirdpartyresources", name) return c.client.delete(ctx, pbCodec, url) } @@ -4938,9 +4656,7 @@ func (c *ExtensionsV1Beta1) GetThirdPartyResource(ctx context.Context, name stri if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("extensions", "v1beta1", ns, "thirdpartyresources", name) + url := c.client.urlFor("extensions", "v1beta1", AllNamespaces, "thirdpartyresources", name) resp := new(extensionsv1beta1.ThirdPartyResource) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -4969,8 +4685,7 @@ func (w *ExtensionsV1Beta1ThirdPartyResourceWatcher) Close() error { } func (c *ExtensionsV1Beta1) WatchThirdPartyResources(ctx context.Context, options ...Option) (*ExtensionsV1Beta1ThirdPartyResourceWatcher, error) { - ns := "" - url := c.client.urlFor("extensions", "v1beta1", ns, "thirdpartyresources", "", options...) + url := c.client.urlFor("extensions", "v1beta1", AllNamespaces, "thirdpartyresources", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -4979,8 +4694,7 @@ func (c *ExtensionsV1Beta1) WatchThirdPartyResources(ctx context.Context, option } func (c *ExtensionsV1Beta1) ListThirdPartyResources(ctx context.Context, options ...Option) (*extensionsv1beta1.ThirdPartyResourceList, error) { - ns := "" - url := c.client.urlFor("extensions", "v1beta1", ns, "thirdpartyresources", "", options...) + url := c.client.urlFor("extensions", "v1beta1", AllNamespaces, "thirdpartyresources", "", options...) resp := new(extensionsv1beta1.ThirdPartyResourceList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -5003,7 +4717,7 @@ func (c *ExtensionsV1Beta1) CreateThirdPartyResourceData(ctx context.Context, ob } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -5032,7 +4746,7 @@ func (c *ExtensionsV1Beta1) UpdateThirdPartyResourceData(ctx context.Context, ob } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -5050,9 +4764,7 @@ func (c *ExtensionsV1Beta1) DeleteThirdPartyResourceData(ctx context.Context, na if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "thirdpartyresourcedatas", name) + url := c.client.urlFor("extensions", "v1beta1", namespace, "thirdpartyresourcedatas", name) return c.client.delete(ctx, pbCodec, url) } @@ -5060,9 +4772,7 @@ func (c *ExtensionsV1Beta1) GetThirdPartyResourceData(ctx context.Context, name, if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "thirdpartyresourcedatas", name) + url := c.client.urlFor("extensions", "v1beta1", namespace, "thirdpartyresourcedatas", name) resp := new(extensionsv1beta1.ThirdPartyResourceData) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -5091,9 +4801,7 @@ func (w *ExtensionsV1Beta1ThirdPartyResourceDataWatcher) Close() error { } func (c *ExtensionsV1Beta1) WatchThirdPartyResourceDatas(ctx context.Context, namespace string, options ...Option) (*ExtensionsV1Beta1ThirdPartyResourceDataWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "thirdpartyresourcedatas", "", options...) + url := c.client.urlFor("extensions", "v1beta1", namespace, "thirdpartyresourcedatas", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -5102,9 +4810,7 @@ func (c *ExtensionsV1Beta1) WatchThirdPartyResourceDatas(ctx context.Context, na } func (c *ExtensionsV1Beta1) ListThirdPartyResourceDatas(ctx context.Context, namespace string, options ...Option) (*extensionsv1beta1.ThirdPartyResourceDataList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("extensions", "v1beta1", ns, "thirdpartyresourcedatas", "", options...) + url := c.client.urlFor("extensions", "v1beta1", namespace, "thirdpartyresourcedatas", "", options...) resp := new(extensionsv1beta1.ThirdPartyResourceDataList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -5138,7 +4844,7 @@ func (c *ImagepolicyV1Alpha1) CreateImageReview(ctx context.Context, obj *imagep } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -5167,7 +4873,7 @@ func (c *ImagepolicyV1Alpha1) UpdateImageReview(ctx context.Context, obj *imagep } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -5185,9 +4891,7 @@ func (c *ImagepolicyV1Alpha1) DeleteImageReview(ctx context.Context, name string if name == "" { return fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("imagepolicy", "v1alpha1", ns, "imagereviews", name) + url := c.client.urlFor("imagepolicy", "v1alpha1", AllNamespaces, "imagereviews", name) return c.client.delete(ctx, pbCodec, url) } @@ -5195,9 +4899,7 @@ func (c *ImagepolicyV1Alpha1) GetImageReview(ctx context.Context, name string) ( if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("imagepolicy", "v1alpha1", ns, "imagereviews", name) + url := c.client.urlFor("imagepolicy", "v1alpha1", AllNamespaces, "imagereviews", name) resp := new(imagepolicyv1alpha1.ImageReview) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -5231,7 +4933,7 @@ func (c *PolicyV1Alpha1) CreateEviction(ctx context.Context, obj *policyv1alpha1 } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -5260,7 +4962,7 @@ func (c *PolicyV1Alpha1) UpdateEviction(ctx context.Context, obj *policyv1alpha1 } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -5278,9 +4980,7 @@ func (c *PolicyV1Alpha1) DeleteEviction(ctx context.Context, name string, namesp if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("policy", "v1alpha1", ns, "evictions", name) + url := c.client.urlFor("policy", "v1alpha1", namespace, "evictions", name) return c.client.delete(ctx, pbCodec, url) } @@ -5288,9 +4988,7 @@ func (c *PolicyV1Alpha1) GetEviction(ctx context.Context, name, namespace string if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("policy", "v1alpha1", ns, "evictions", name) + url := c.client.urlFor("policy", "v1alpha1", namespace, "evictions", name) resp := new(policyv1alpha1.Eviction) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -5313,7 +5011,7 @@ func (c *PolicyV1Alpha1) CreatePodDisruptionBudget(ctx context.Context, obj *pol } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -5342,7 +5040,7 @@ func (c *PolicyV1Alpha1) UpdatePodDisruptionBudget(ctx context.Context, obj *pol } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -5360,9 +5058,7 @@ func (c *PolicyV1Alpha1) DeletePodDisruptionBudget(ctx context.Context, name str if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("policy", "v1alpha1", ns, "poddisruptionbudgets", name) + url := c.client.urlFor("policy", "v1alpha1", namespace, "poddisruptionbudgets", name) return c.client.delete(ctx, pbCodec, url) } @@ -5370,9 +5066,7 @@ func (c *PolicyV1Alpha1) GetPodDisruptionBudget(ctx context.Context, name, names if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("policy", "v1alpha1", ns, "poddisruptionbudgets", name) + url := c.client.urlFor("policy", "v1alpha1", namespace, "poddisruptionbudgets", name) resp := new(policyv1alpha1.PodDisruptionBudget) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -5401,9 +5095,7 @@ func (w *PolicyV1Alpha1PodDisruptionBudgetWatcher) Close() error { } func (c *PolicyV1Alpha1) WatchPodDisruptionBudgets(ctx context.Context, namespace string, options ...Option) (*PolicyV1Alpha1PodDisruptionBudgetWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("policy", "v1alpha1", ns, "poddisruptionbudgets", "", options...) + url := c.client.urlFor("policy", "v1alpha1", namespace, "poddisruptionbudgets", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -5412,9 +5104,7 @@ func (c *PolicyV1Alpha1) WatchPodDisruptionBudgets(ctx context.Context, namespac } func (c *PolicyV1Alpha1) ListPodDisruptionBudgets(ctx context.Context, namespace string, options ...Option) (*policyv1alpha1.PodDisruptionBudgetList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("policy", "v1alpha1", ns, "poddisruptionbudgets", "", options...) + url := c.client.urlFor("policy", "v1alpha1", namespace, "poddisruptionbudgets", "", options...) resp := new(policyv1alpha1.PodDisruptionBudgetList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -5448,7 +5138,7 @@ func (c *PolicyV1Beta1) CreateEviction(ctx context.Context, obj *policyv1beta1.E } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -5477,7 +5167,7 @@ func (c *PolicyV1Beta1) UpdateEviction(ctx context.Context, obj *policyv1beta1.E } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -5495,9 +5185,7 @@ func (c *PolicyV1Beta1) DeleteEviction(ctx context.Context, name string, namespa if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("policy", "v1beta1", ns, "evictions", name) + url := c.client.urlFor("policy", "v1beta1", namespace, "evictions", name) return c.client.delete(ctx, pbCodec, url) } @@ -5505,9 +5193,7 @@ func (c *PolicyV1Beta1) GetEviction(ctx context.Context, name, namespace string) if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("policy", "v1beta1", ns, "evictions", name) + url := c.client.urlFor("policy", "v1beta1", namespace, "evictions", name) resp := new(policyv1beta1.Eviction) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -5530,7 +5216,7 @@ func (c *PolicyV1Beta1) CreatePodDisruptionBudget(ctx context.Context, obj *poli } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -5559,7 +5245,7 @@ func (c *PolicyV1Beta1) UpdatePodDisruptionBudget(ctx context.Context, obj *poli } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -5577,9 +5263,7 @@ func (c *PolicyV1Beta1) DeletePodDisruptionBudget(ctx context.Context, name stri if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("policy", "v1beta1", ns, "poddisruptionbudgets", name) + url := c.client.urlFor("policy", "v1beta1", namespace, "poddisruptionbudgets", name) return c.client.delete(ctx, pbCodec, url) } @@ -5587,9 +5271,7 @@ func (c *PolicyV1Beta1) GetPodDisruptionBudget(ctx context.Context, name, namesp if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("policy", "v1beta1", ns, "poddisruptionbudgets", name) + url := c.client.urlFor("policy", "v1beta1", namespace, "poddisruptionbudgets", name) resp := new(policyv1beta1.PodDisruptionBudget) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -5618,9 +5300,7 @@ func (w *PolicyV1Beta1PodDisruptionBudgetWatcher) Close() error { } func (c *PolicyV1Beta1) WatchPodDisruptionBudgets(ctx context.Context, namespace string, options ...Option) (*PolicyV1Beta1PodDisruptionBudgetWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("policy", "v1beta1", ns, "poddisruptionbudgets", "", options...) + url := c.client.urlFor("policy", "v1beta1", namespace, "poddisruptionbudgets", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -5629,9 +5309,7 @@ func (c *PolicyV1Beta1) WatchPodDisruptionBudgets(ctx context.Context, namespace } func (c *PolicyV1Beta1) ListPodDisruptionBudgets(ctx context.Context, namespace string, options ...Option) (*policyv1beta1.PodDisruptionBudgetList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("policy", "v1beta1", ns, "poddisruptionbudgets", "", options...) + url := c.client.urlFor("policy", "v1beta1", namespace, "poddisruptionbudgets", "", options...) resp := new(policyv1beta1.PodDisruptionBudgetList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -5665,7 +5343,7 @@ func (c *RBACV1Alpha1) CreateClusterRole(ctx context.Context, obj *rbacv1alpha1. } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -5694,7 +5372,7 @@ func (c *RBACV1Alpha1) UpdateClusterRole(ctx context.Context, obj *rbacv1alpha1. } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -5712,9 +5390,7 @@ func (c *RBACV1Alpha1) DeleteClusterRole(ctx context.Context, name string) error if name == "" { return fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", ns, "clusterroles", name) + url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", AllNamespaces, "clusterroles", name) return c.client.delete(ctx, pbCodec, url) } @@ -5722,9 +5398,7 @@ func (c *RBACV1Alpha1) GetClusterRole(ctx context.Context, name string) (*rbacv1 if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", ns, "clusterroles", name) + url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", AllNamespaces, "clusterroles", name) resp := new(rbacv1alpha1.ClusterRole) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -5753,8 +5427,7 @@ func (w *RBACV1Alpha1ClusterRoleWatcher) Close() error { } func (c *RBACV1Alpha1) WatchClusterRoles(ctx context.Context, options ...Option) (*RBACV1Alpha1ClusterRoleWatcher, error) { - ns := "" - url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", ns, "clusterroles", "", options...) + url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", AllNamespaces, "clusterroles", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -5763,8 +5436,7 @@ func (c *RBACV1Alpha1) WatchClusterRoles(ctx context.Context, options ...Option) } func (c *RBACV1Alpha1) ListClusterRoles(ctx context.Context, options ...Option) (*rbacv1alpha1.ClusterRoleList, error) { - ns := "" - url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", ns, "clusterroles", "", options...) + url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", AllNamespaces, "clusterroles", "", options...) resp := new(rbacv1alpha1.ClusterRoleList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -5787,7 +5459,7 @@ func (c *RBACV1Alpha1) CreateClusterRoleBinding(ctx context.Context, obj *rbacv1 } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -5816,7 +5488,7 @@ func (c *RBACV1Alpha1) UpdateClusterRoleBinding(ctx context.Context, obj *rbacv1 } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -5834,9 +5506,7 @@ func (c *RBACV1Alpha1) DeleteClusterRoleBinding(ctx context.Context, name string if name == "" { return fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", ns, "clusterrolebindings", name) + url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", AllNamespaces, "clusterrolebindings", name) return c.client.delete(ctx, pbCodec, url) } @@ -5844,9 +5514,7 @@ func (c *RBACV1Alpha1) GetClusterRoleBinding(ctx context.Context, name string) ( if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", ns, "clusterrolebindings", name) + url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", AllNamespaces, "clusterrolebindings", name) resp := new(rbacv1alpha1.ClusterRoleBinding) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -5875,8 +5543,7 @@ func (w *RBACV1Alpha1ClusterRoleBindingWatcher) Close() error { } func (c *RBACV1Alpha1) WatchClusterRoleBindings(ctx context.Context, options ...Option) (*RBACV1Alpha1ClusterRoleBindingWatcher, error) { - ns := "" - url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", ns, "clusterrolebindings", "", options...) + url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", AllNamespaces, "clusterrolebindings", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -5885,8 +5552,7 @@ func (c *RBACV1Alpha1) WatchClusterRoleBindings(ctx context.Context, options ... } func (c *RBACV1Alpha1) ListClusterRoleBindings(ctx context.Context, options ...Option) (*rbacv1alpha1.ClusterRoleBindingList, error) { - ns := "" - url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", ns, "clusterrolebindings", "", options...) + url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", AllNamespaces, "clusterrolebindings", "", options...) resp := new(rbacv1alpha1.ClusterRoleBindingList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -5909,7 +5575,7 @@ func (c *RBACV1Alpha1) CreateRole(ctx context.Context, obj *rbacv1alpha1.Role) ( } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -5938,7 +5604,7 @@ func (c *RBACV1Alpha1) UpdateRole(ctx context.Context, obj *rbacv1alpha1.Role) ( } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -5956,9 +5622,7 @@ func (c *RBACV1Alpha1) DeleteRole(ctx context.Context, name string, namespace st if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", ns, "roles", name) + url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", namespace, "roles", name) return c.client.delete(ctx, pbCodec, url) } @@ -5966,9 +5630,7 @@ func (c *RBACV1Alpha1) GetRole(ctx context.Context, name, namespace string) (*rb if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", ns, "roles", name) + url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", namespace, "roles", name) resp := new(rbacv1alpha1.Role) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -5997,9 +5659,7 @@ func (w *RBACV1Alpha1RoleWatcher) Close() error { } func (c *RBACV1Alpha1) WatchRoles(ctx context.Context, namespace string, options ...Option) (*RBACV1Alpha1RoleWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", ns, "roles", "", options...) + url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", namespace, "roles", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -6008,9 +5668,7 @@ func (c *RBACV1Alpha1) WatchRoles(ctx context.Context, namespace string, options } func (c *RBACV1Alpha1) ListRoles(ctx context.Context, namespace string, options ...Option) (*rbacv1alpha1.RoleList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", ns, "roles", "", options...) + url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", namespace, "roles", "", options...) resp := new(rbacv1alpha1.RoleList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -6033,7 +5691,7 @@ func (c *RBACV1Alpha1) CreateRoleBinding(ctx context.Context, obj *rbacv1alpha1. } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -6062,7 +5720,7 @@ func (c *RBACV1Alpha1) UpdateRoleBinding(ctx context.Context, obj *rbacv1alpha1. } if true { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -6080,9 +5738,7 @@ func (c *RBACV1Alpha1) DeleteRoleBinding(ctx context.Context, name string, names if name == "" { return fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", ns, "rolebindings", name) + url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", namespace, "rolebindings", name) return c.client.delete(ctx, pbCodec, url) } @@ -6090,9 +5746,7 @@ func (c *RBACV1Alpha1) GetRoleBinding(ctx context.Context, name, namespace strin if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", ns, "rolebindings", name) + url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", namespace, "rolebindings", name) resp := new(rbacv1alpha1.RoleBinding) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -6121,9 +5775,7 @@ func (w *RBACV1Alpha1RoleBindingWatcher) Close() error { } func (c *RBACV1Alpha1) WatchRoleBindings(ctx context.Context, namespace string, options ...Option) (*RBACV1Alpha1RoleBindingWatcher, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", ns, "rolebindings", "", options...) + url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", namespace, "rolebindings", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -6132,9 +5784,7 @@ func (c *RBACV1Alpha1) WatchRoleBindings(ctx context.Context, namespace string, } func (c *RBACV1Alpha1) ListRoleBindings(ctx context.Context, namespace string, options ...Option) (*rbacv1alpha1.RoleBindingList, error) { - ns := c.client.namespaceFor(namespace) - - url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", ns, "rolebindings", "", options...) + url := c.client.urlFor("rbac.authorization.k8s.io", "v1alpha1", namespace, "rolebindings", "", options...) resp := new(rbacv1alpha1.RoleBindingList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -6168,7 +5818,7 @@ func (c *StorageV1Beta1) CreateStorageClass(ctx context.Context, obj *storagev1b } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -6197,7 +5847,7 @@ func (c *StorageV1Beta1) UpdateStorageClass(ctx context.Context, obj *storagev1b } if false { - if ns = c.client.namespaceFor(ns); ns == "" { + if ns == "" { return nil, fmt.Errorf("no resource namespace provided") } md.Namespace = &ns @@ -6215,9 +5865,7 @@ func (c *StorageV1Beta1) DeleteStorageClass(ctx context.Context, name string) er if name == "" { return fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("storage.k8s.io", "v1beta1", ns, "storageclasses", name) + url := c.client.urlFor("storage.k8s.io", "v1beta1", AllNamespaces, "storageclasses", name) return c.client.delete(ctx, pbCodec, url) } @@ -6225,9 +5873,7 @@ func (c *StorageV1Beta1) GetStorageClass(ctx context.Context, name string) (*sto if name == "" { return nil, fmt.Errorf("create: no name for given object") } - ns := "" - - url := c.client.urlFor("storage.k8s.io", "v1beta1", ns, "storageclasses", name) + url := c.client.urlFor("storage.k8s.io", "v1beta1", AllNamespaces, "storageclasses", name) resp := new(storagev1beta1.StorageClass) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err @@ -6256,8 +5902,7 @@ func (w *StorageV1Beta1StorageClassWatcher) Close() error { } func (c *StorageV1Beta1) WatchStorageClasses(ctx context.Context, options ...Option) (*StorageV1Beta1StorageClassWatcher, error) { - ns := "" - url := c.client.urlFor("storage.k8s.io", "v1beta1", ns, "storageclasses", "", options...) + url := c.client.urlFor("storage.k8s.io", "v1beta1", AllNamespaces, "storageclasses", "", options...) watcher, err := c.client.watch(ctx, url) if err != nil { return nil, err @@ -6266,8 +5911,7 @@ func (c *StorageV1Beta1) WatchStorageClasses(ctx context.Context, options ...Opt } func (c *StorageV1Beta1) ListStorageClasses(ctx context.Context, options ...Option) (*storagev1beta1.StorageClassList, error) { - ns := "" - url := c.client.urlFor("storage.k8s.io", "v1beta1", ns, "storageclasses", "", options...) + url := c.client.urlFor("storage.k8s.io", "v1beta1", AllNamespaces, "storageclasses", "", options...) resp := new(storagev1beta1.StorageClassList) if err := c.client.get(ctx, pbCodec, url, resp); err != nil { return nil, err