mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +00:00
Merge pull request #19307 from caesarxuchao/remove-namespaceifscoped
Auto commit by PR queue bot
This commit is contained in:
commit
e7f29514ab
@ -161,7 +161,7 @@ var deleteCollectionTemplate = `
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *$.type|privatePlural$) DeleteCollection(options *$.apiDeleteOptions|raw$, listOptions $.apiListOptions|raw$) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("$.type|privatePlural$").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -92,7 +92,7 @@ func (c *testTypes) Delete(name string, options *api.DeleteOptions) error {
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *testTypes) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("testTypes").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -92,7 +92,7 @@ func (c *daemonSets) Delete(name string, options *api.DeleteOptions) error {
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *daemonSets) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("daemonSets").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -92,7 +92,7 @@ func (c *deployments) Delete(name string, options *api.DeleteOptions) error {
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *deployments) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("deployments").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -92,7 +92,7 @@ func (c *horizontalPodAutoscalers) Delete(name string, options *api.DeleteOption
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *horizontalPodAutoscalers) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("horizontalPodAutoscalers").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -92,7 +92,7 @@ func (c *ingresses) Delete(name string, options *api.DeleteOptions) error {
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *ingresses) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("ingresses").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -92,7 +92,7 @@ func (c *jobs) Delete(name string, options *api.DeleteOptions) error {
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *jobs) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("jobs").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -92,7 +92,7 @@ func (c *thirdPartyResources) Delete(name string, options *api.DeleteOptions) er
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *thirdPartyResources) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("thirdPartyResources").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -91,7 +91,7 @@ func (c *componentStatus) Delete(name string, options *api.DeleteOptions) error
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *componentStatus) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("componentStatus").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -91,7 +91,7 @@ func (c *endpoints) Delete(name string, options *api.DeleteOptions) error {
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *endpoints) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("endpoints").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -91,7 +91,7 @@ func (c *events) Delete(name string, options *api.DeleteOptions) error {
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *events) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("events").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -91,7 +91,7 @@ func (c *limitRanges) Delete(name string, options *api.DeleteOptions) error {
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *limitRanges) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("limitRanges").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -91,7 +91,7 @@ func (c *namespaces) Delete(name string, options *api.DeleteOptions) error {
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *namespaces) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("namespaces").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -91,7 +91,7 @@ func (c *nodes) Delete(name string, options *api.DeleteOptions) error {
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *nodes) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("nodes").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -91,7 +91,7 @@ func (c *persistentVolumes) Delete(name string, options *api.DeleteOptions) erro
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *persistentVolumes) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("persistentVolumes").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -91,7 +91,7 @@ func (c *persistentVolumeClaims) Delete(name string, options *api.DeleteOptions)
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *persistentVolumeClaims) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("persistentVolumeClaims").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -91,7 +91,7 @@ func (c *pods) Delete(name string, options *api.DeleteOptions) error {
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *pods) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("pods").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -91,7 +91,7 @@ func (c *podTemplates) Delete(name string, options *api.DeleteOptions) error {
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *podTemplates) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("podTemplates").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -91,7 +91,7 @@ func (c *replicationControllers) Delete(name string, options *api.DeleteOptions)
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *replicationControllers) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("replicationControllers").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -91,7 +91,7 @@ func (c *resourceQuotas) Delete(name string, options *api.DeleteOptions) error {
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *resourceQuotas) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("resourceQuotas").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -91,7 +91,7 @@ func (c *secrets) Delete(name string, options *api.DeleteOptions) error {
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *secrets) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("secrets").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -91,7 +91,7 @@ func (c *services) Delete(name string, options *api.DeleteOptions) error {
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *services) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("services").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -91,7 +91,7 @@ func (c *serviceAccounts) Delete(name string, options *api.DeleteOptions) error
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (c *serviceAccounts) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return c.client.Delete().
|
||||
NamespaceIfScoped(c.ns, len(c.ns) > 0).
|
||||
Namespace(c.ns).
|
||||
Resource("serviceAccounts").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
@ -72,7 +72,7 @@ func (e *events) Create(event *api.Event) (*api.Event, error) {
|
||||
}
|
||||
result := &api.Event{}
|
||||
err := e.client.Post().
|
||||
NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0).
|
||||
Namespace(event.Namespace).
|
||||
Resource("events").
|
||||
Body(event).
|
||||
Do().
|
||||
@ -91,7 +91,7 @@ func (e *events) Update(event *api.Event) (*api.Event, error) {
|
||||
}
|
||||
result := &api.Event{}
|
||||
err := e.client.Put().
|
||||
NamespaceIfScoped(event.Namespace, len(event.Namespace) > 0).
|
||||
Namespace(event.Namespace).
|
||||
Resource("events").
|
||||
Name(event.Name).
|
||||
Body(event).
|
||||
@ -107,7 +107,7 @@ func (e *events) Update(event *api.Event) (*api.Event, error) {
|
||||
func (e *events) Patch(incompleteEvent *api.Event, data []byte) (*api.Event, error) {
|
||||
result := &api.Event{}
|
||||
err := e.client.Patch(api.StrategicMergePatchType).
|
||||
NamespaceIfScoped(incompleteEvent.Namespace, len(incompleteEvent.Namespace) > 0).
|
||||
Namespace(incompleteEvent.Namespace).
|
||||
Resource("events").
|
||||
Name(incompleteEvent.Name).
|
||||
Body(data).
|
||||
@ -120,7 +120,7 @@ func (e *events) Patch(incompleteEvent *api.Event, data []byte) (*api.Event, err
|
||||
func (e *events) List(opts api.ListOptions) (*api.EventList, error) {
|
||||
result := &api.EventList{}
|
||||
err := e.client.Get().
|
||||
NamespaceIfScoped(e.namespace, len(e.namespace) > 0).
|
||||
Namespace(e.namespace).
|
||||
Resource("events").
|
||||
VersionedParams(&opts, api.Scheme).
|
||||
Do().
|
||||
@ -132,7 +132,7 @@ func (e *events) List(opts api.ListOptions) (*api.EventList, error) {
|
||||
func (e *events) Get(name string) (*api.Event, error) {
|
||||
result := &api.Event{}
|
||||
err := e.client.Get().
|
||||
NamespaceIfScoped(e.namespace, len(e.namespace) > 0).
|
||||
Namespace(e.namespace).
|
||||
Resource("events").
|
||||
Name(name).
|
||||
Do().
|
||||
@ -144,7 +144,7 @@ func (e *events) Get(name string) (*api.Event, error) {
|
||||
func (e *events) Watch(opts api.ListOptions) (watch.Interface, error) {
|
||||
return e.client.Get().
|
||||
Prefix("watch").
|
||||
NamespaceIfScoped(e.namespace, len(e.namespace) > 0).
|
||||
Namespace(e.namespace).
|
||||
Resource("events").
|
||||
VersionedParams(&opts, api.Scheme).
|
||||
Watch()
|
||||
@ -178,7 +178,7 @@ func (e *events) Search(objOrRef runtime.Object) (*api.EventList, error) {
|
||||
// Delete deletes an existing event.
|
||||
func (e *events) Delete(name string) error {
|
||||
return e.client.Delete().
|
||||
NamespaceIfScoped(e.namespace, len(e.namespace) > 0).
|
||||
Namespace(e.namespace).
|
||||
Resource("events").
|
||||
Name(name).
|
||||
Do().
|
||||
@ -188,7 +188,7 @@ func (e *events) Delete(name string) error {
|
||||
// DeleteCollection deletes a collection of objects.
|
||||
func (e *events) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error {
|
||||
return e.client.Delete().
|
||||
NamespaceIfScoped(e.namespace, len(e.namespace) > 0).
|
||||
Namespace(e.namespace).
|
||||
Resource("events").
|
||||
VersionedParams(&listOptions, api.Scheme).
|
||||
Body(options).
|
||||
|
Loading…
Reference in New Issue
Block a user