Skip to content

Commit

Permalink
fix(platform): block in tke-xx controller (#1729)
Browse files Browse the repository at this point in the history
  • Loading branch information
leoryu authored Dec 28, 2021
1 parent a351a50 commit 79e2aba
Show file tree
Hide file tree
Showing 32 changed files with 0 additions and 149 deletions.
5 changes: 0 additions & 5 deletions pkg/auth/registry/localgroup/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import (
"k8s.io/apiserver/pkg/storage"
storageerr "k8s.io/apiserver/pkg/storage/errors"
"k8s.io/apiserver/pkg/util/dryrun"
"tkestack.io/tke/pkg/apiserver/authentication"

"tkestack.io/tke/api/auth"
apiserverutil "tkestack.io/tke/pkg/apiserver/util"
Expand Down Expand Up @@ -191,10 +190,6 @@ func (r *REST) List(ctx context.Context, options *metainternal.ListOptions) (run
// DeleteCollection selects all resources in the storage matching given 'listOptions'
// and deletes them.
func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error) {
if !authentication.IsAdministrator(ctx, r.privilegedUsername) {
return nil, apierrors.NewMethodNotSupported(auth.Resource("groups"), "delete collection")
}

if listOptions == nil {
listOptions = &metainternal.ListOptions{}
} else {
Expand Down
4 changes: 0 additions & 4 deletions pkg/auth/registry/localidentity/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,6 @@ func (r *REST) List(ctx context.Context, options *metainternal.ListOptions) (run
// DeleteCollection selects all resources in the storage matching given 'listOptions'
// and deletes them.
func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error) {
if !authentication.IsAdministrator(ctx, r.privilegedUsername) {
return nil, apierrors.NewMethodNotSupported(auth.Resource("localIdentities"), "delete collection")
}

if listOptions == nil {
listOptions = &metainternal.ListOptions{}
} else {
Expand Down
5 changes: 0 additions & 5 deletions pkg/auth/registry/policy/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (
"k8s.io/apiserver/pkg/storage"
storageerr "k8s.io/apiserver/pkg/storage/errors"
"k8s.io/apiserver/pkg/util/dryrun"
"tkestack.io/tke/pkg/apiserver/authentication"

"tkestack.io/tke/api/auth"
authinternalclient "tkestack.io/tke/api/client/clientset/internalversion/typed/auth/internalversion"
Expand Down Expand Up @@ -174,10 +173,6 @@ func (r *REST) List(ctx context.Context, options *metainternal.ListOptions) (run
// DeleteCollection selects all resources in the storage matching given 'listOptions'
// and deletes them.
func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error) {
if !authentication.IsAdministrator(ctx, r.privilegedUsername) {
return nil, apierrors.NewMethodNotSupported(auth.Resource("policies"), "delete collection")
}

if listOptions == nil {
listOptions = &metainternal.ListOptions{}
} else {
Expand Down
5 changes: 0 additions & 5 deletions pkg/auth/registry/projectpolicybinding/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import (

"tkestack.io/tke/api/auth"
authinternalclient "tkestack.io/tke/api/client/clientset/internalversion/typed/auth/internalversion"
"tkestack.io/tke/pkg/apiserver/authentication"
apiserverutil "tkestack.io/tke/pkg/apiserver/util"
"tkestack.io/tke/pkg/auth/registry/projectpolicybinding"
"tkestack.io/tke/pkg/auth/util"
Expand Down Expand Up @@ -142,10 +141,6 @@ func (r *REST) ShortNames() []string {
// DeleteCollection selects all resources in the storage matching given 'listOptions'
// and deletes them.
func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error) {
if !authentication.IsAdministrator(ctx, r.privilegedUsername) {
return nil, apierrors.NewMethodNotSupported(auth.Resource("ProjectPolicyBindings"), "delete collection")
}

if listOptions == nil {
listOptions = &metainternal.ListOptions{}
} else {
Expand Down
5 changes: 0 additions & 5 deletions pkg/auth/registry/role/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import (
"k8s.io/apiserver/pkg/storage"
storageerr "k8s.io/apiserver/pkg/storage/errors"
"k8s.io/apiserver/pkg/util/dryrun"
"tkestack.io/tke/pkg/apiserver/authentication"

"tkestack.io/tke/api/auth"
apiserverutil "tkestack.io/tke/pkg/apiserver/util"
Expand Down Expand Up @@ -170,10 +169,6 @@ func (r *REST) List(ctx context.Context, options *metainternal.ListOptions) (run
// DeleteCollection selects all resources in the storage matching given 'listOptions'
// and deletes them.
func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error) {
if !authentication.IsAdministrator(ctx, r.privilegedUsername) {
return nil, apierrors.NewMethodNotSupported(auth.Resource("roles"), "delete collection")
}

if listOptions == nil {
listOptions = &metainternal.ListOptions{}
} else {
Expand Down
4 changes: 0 additions & 4 deletions pkg/business/registry/chartgroup/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
"tkestack.io/tke/api/business"
businessinternalclient "tkestack.io/tke/api/client/clientset/internalversion/typed/business/internalversion"
registryversionedclient "tkestack.io/tke/api/client/clientset/versioned/typed/registry/v1"
"tkestack.io/tke/pkg/apiserver/authentication"
apiserverutil "tkestack.io/tke/pkg/apiserver/util"
"tkestack.io/tke/pkg/business/registry/chartgroup"
"tkestack.io/tke/pkg/business/util"
Expand Down Expand Up @@ -117,9 +116,6 @@ func (r *REST) ShortNames() []string {
// and deletes them.
func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc,
options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error) {
if !authentication.IsAdministrator(ctx, r.privilegedUsername) {
return nil, errors.NewMethodNotSupported(business.Resource("chartgroups"), "delete collection")
}
return r.Store.DeleteCollection(ctx, deleteValidation, options, listOptions)
}

Expand Down
4 changes: 0 additions & 4 deletions pkg/business/registry/emigration/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
"tkestack.io/tke/api/business"
businessinternalclient "tkestack.io/tke/api/client/clientset/internalversion/typed/business/internalversion"
platformversionedclient "tkestack.io/tke/api/client/clientset/versioned/typed/platform/v1"
"tkestack.io/tke/pkg/apiserver/authentication"
apiserverutil "tkestack.io/tke/pkg/apiserver/util"
"tkestack.io/tke/pkg/business/registry/emigration"
"tkestack.io/tke/pkg/business/util"
Expand Down Expand Up @@ -113,9 +112,6 @@ func (r *REST) ShortNames() []string {
// and deletes them.
func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc,
options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error) {
if !authentication.IsAdministrator(ctx, r.privilegedUsername) {
return nil, errors.NewMethodNotSupported(business.Resource("nsemigrations"), "delete collection")
}
return r.Store.DeleteCollection(ctx, deleteValidation, options, listOptions)
}

Expand Down
4 changes: 0 additions & 4 deletions pkg/business/registry/imagenamespace/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
"tkestack.io/tke/api/business"
businessinternalclient "tkestack.io/tke/api/client/clientset/internalversion/typed/business/internalversion"
registryversionedclient "tkestack.io/tke/api/client/clientset/versioned/typed/registry/v1"
"tkestack.io/tke/pkg/apiserver/authentication"
apiserverutil "tkestack.io/tke/pkg/apiserver/util"
"tkestack.io/tke/pkg/business/registry/imagenamespace"
"tkestack.io/tke/pkg/business/util"
Expand Down Expand Up @@ -119,9 +118,6 @@ func (r *REST) ShortNames() []string {
// and deletes them.
func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc,
options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error) {
if !authentication.IsAdministrator(ctx, r.privilegedUsername) {
return nil, errors.NewMethodNotSupported(business.Resource("imagenamespaces"), "delete collection")
}
return r.Store.DeleteCollection(ctx, deleteValidation, options, listOptions)
}

Expand Down
3 changes: 0 additions & 3 deletions pkg/business/registry/namespace/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ func (r *REST) ShortNames() []string {
// DeleteCollection selects all resources in the storage matching given 'listOptions'
// and deletes them.
func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error) {
if !authentication.IsAdministrator(ctx, r.privilegedUsername) {
return nil, errors.NewMethodNotSupported(business.Resource("namespaces"), "delete collection")
}
return r.Store.DeleteCollection(ctx, deleteValidation, options, listOptions)
}

Expand Down
5 changes: 0 additions & 5 deletions pkg/business/registry/platform/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package storage
import (
"context"

"k8s.io/apimachinery/pkg/api/errors"
metainternal "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand All @@ -30,7 +29,6 @@ import (
"k8s.io/apiserver/pkg/registry/rest"
"tkestack.io/tke/api/business"
businessinternalclient "tkestack.io/tke/api/client/clientset/internalversion/typed/business/internalversion"
"tkestack.io/tke/pkg/apiserver/authentication"
apiserverutil "tkestack.io/tke/pkg/apiserver/util"
platformstrategy "tkestack.io/tke/pkg/business/registry/platform"
"tkestack.io/tke/pkg/business/util"
Expand Down Expand Up @@ -108,9 +106,6 @@ func (r *REST) List(ctx context.Context, options *metainternal.ListOptions) (run
// DeleteCollection selects all resources in the storage matching given 'listOptions'
// and deletes them.
func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error) {
if !authentication.IsAdministrator(ctx, r.privilegedUsername) {
return nil, errors.NewMethodNotSupported(business.Resource("platforms"), "delete collection")
}
return r.Store.DeleteCollection(ctx, deleteValidation, options, listOptions)
}

Expand Down
4 changes: 0 additions & 4 deletions pkg/business/registry/project/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (
authversionedclient "tkestack.io/tke/api/client/clientset/versioned/typed/auth/v1"
platformversionedclient "tkestack.io/tke/api/client/clientset/versioned/typed/platform/v1"
"tkestack.io/tke/cmd/tke-business-api/app/options"
"tkestack.io/tke/pkg/apiserver/authentication"
apiserverutil "tkestack.io/tke/pkg/apiserver/util"
projectstrategy "tkestack.io/tke/pkg/business/registry/project"
"tkestack.io/tke/pkg/business/util"
Expand Down Expand Up @@ -134,9 +133,6 @@ func (r *REST) List(ctx context.Context, options *metainternal.ListOptions) (run
// DeleteCollection selects all resources in the storage matching given 'listOptions'
// and deletes them.
func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error) {
if !authentication.IsAdministrator(ctx, r.privilegedUsername) {
return nil, apierrors.NewMethodNotSupported(business.Resource("projects"), "delete collection")
}
return r.Store.DeleteCollection(ctx, deleteValidation, options, listOptions)
}

Expand Down
5 changes: 0 additions & 5 deletions pkg/logagent/registry/logagent/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ package storage
import (
"context"

"k8s.io/apimachinery/pkg/api/errors"
metainternal "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand All @@ -30,7 +29,6 @@ import (
"k8s.io/apiserver/pkg/registry/rest"
platformversionedclient "tkestack.io/tke/api/client/clientset/versioned/typed/platform/v1"
"tkestack.io/tke/api/logagent"
"tkestack.io/tke/pkg/apiserver/authentication"
apiserverutil "tkestack.io/tke/pkg/apiserver/util"
registrylogagent "tkestack.io/tke/pkg/logagent/registry/logagent"
"tkestack.io/tke/pkg/logagent/util"
Expand Down Expand Up @@ -154,9 +152,6 @@ func (r *REST) Delete(ctx context.Context, name string, deleteValidation rest.Va
// DeleteCollection selects all resources in the storage matching given 'listOptions'
// and deletes them.
func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error) {
if !authentication.IsAdministrator(ctx, r.privilegedUsername) {
return nil, errors.NewMethodNotSupported(logagent.Resource("logagents"), "delete collection")
}
return r.Store.DeleteCollection(ctx, deleteValidation, options, listOptions)
}

Expand Down
5 changes: 0 additions & 5 deletions pkg/mesh/registry/meshmanager/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ package storage
import (
"context"

"k8s.io/apimachinery/pkg/api/errors"
metainternal "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
genericregistry "k8s.io/apiserver/pkg/registry/generic"
"k8s.io/apiserver/pkg/registry/generic/registry"
"k8s.io/apiserver/pkg/registry/rest"
"tkestack.io/tke/api/mesh"
"tkestack.io/tke/pkg/apiserver/authentication"
apiserverutil "tkestack.io/tke/pkg/apiserver/util"
meshmanagerstrategy "tkestack.io/tke/pkg/mesh/registry/meshmanager"
"tkestack.io/tke/pkg/mesh/util"
Expand Down Expand Up @@ -137,9 +135,6 @@ func (r *REST) Delete(ctx context.Context, name string, deleteValidation rest.Va
// DeleteCollection selects all resources in the storage matching given 'listOptions'
// and deletes them.
func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error) {
if !authentication.IsAdministrator(ctx, r.privilegedUsername) {
return nil, errors.NewMethodNotSupported(mesh.Resource("meshmanagers"), "delete collection")
}
return r.Store.DeleteCollection(ctx, deleteValidation, options, listOptions)
}

Expand Down
5 changes: 0 additions & 5 deletions pkg/monitor/registry/prometheus/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ package storage
import (
"context"

"k8s.io/apimachinery/pkg/api/errors"
metainternal "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
genericregistry "k8s.io/apiserver/pkg/registry/generic"
"k8s.io/apiserver/pkg/registry/generic/registry"
"k8s.io/apiserver/pkg/registry/rest"
"tkestack.io/tke/api/monitor"
"tkestack.io/tke/pkg/apiserver/authentication"
apiserverutil "tkestack.io/tke/pkg/apiserver/util"
"tkestack.io/tke/pkg/monitor/registry/prometheus"
"tkestack.io/tke/pkg/monitor/util"
Expand Down Expand Up @@ -136,9 +134,6 @@ func (r *REST) Delete(ctx context.Context, name string, deleteValidation rest.Va
// DeleteCollection selects all resources in the storage matching given 'listOptions'
// and deletes them.
func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error) {
if !authentication.IsAdministrator(ctx, r.privilegedUsername) {
return nil, errors.NewMethodNotSupported(monitor.Resource("prometheuses"), "delete collection")
}
return r.Store.DeleteCollection(ctx, deleteValidation, options, listOptions)
}

Expand Down
4 changes: 0 additions & 4 deletions pkg/notify/registry/channel/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (
storageerr "k8s.io/apiserver/pkg/storage/errors"
"k8s.io/apiserver/pkg/util/dryrun"
"tkestack.io/tke/api/notify"
"tkestack.io/tke/pkg/apiserver/authentication"
apiserverutil "tkestack.io/tke/pkg/apiserver/util"
channelstrategy "tkestack.io/tke/pkg/notify/registry/channel"
"tkestack.io/tke/pkg/notify/util"
Expand Down Expand Up @@ -120,9 +119,6 @@ func (r *REST) List(ctx context.Context, options *metainternal.ListOptions) (run
// DeleteCollection selects all resources in the storage matching given 'listOptions'
// and deletes them.
func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error) {
if !authentication.IsAdministrator(ctx, r.privilegedUsername) {
return nil, errors.NewMethodNotSupported(notify.Resource("channels"), "delete collection")
}
return r.Store.DeleteCollection(ctx, deleteValidation, options, listOptions)
}

Expand Down
5 changes: 0 additions & 5 deletions pkg/notify/registry/message/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,13 @@ import (
"context"
"time"

"k8s.io/apimachinery/pkg/api/errors"
metainternal "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
genericregistry "k8s.io/apiserver/pkg/registry/generic"
"k8s.io/apiserver/pkg/registry/generic/registry"
"k8s.io/apiserver/pkg/registry/rest"
"tkestack.io/tke/api/notify"
"tkestack.io/tke/pkg/apiserver/authentication"
apiserverutil "tkestack.io/tke/pkg/apiserver/util"
messagestrategy "tkestack.io/tke/pkg/notify/registry/message"
"tkestack.io/tke/pkg/notify/util"
Expand Down Expand Up @@ -115,9 +113,6 @@ func (r *REST) List(ctx context.Context, options *metainternal.ListOptions) (run
// DeleteCollection selects all resources in the storage matching given 'listOptions'
// and deletes them.
func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error) {
if !authentication.IsAdministrator(ctx, r.privilegedUsername) {
return nil, errors.NewMethodNotSupported(notify.Resource("messages"), "delete collection")
}
return r.Store.DeleteCollection(ctx, deleteValidation, options, listOptions)
}

Expand Down
5 changes: 0 additions & 5 deletions pkg/notify/registry/messagerequest/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"context"
"time"

"k8s.io/apimachinery/pkg/api/errors"
metainternal "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand All @@ -31,7 +30,6 @@ import (
"k8s.io/apiserver/pkg/registry/rest"
notifyinternalclient "tkestack.io/tke/api/client/clientset/internalversion/typed/notify/internalversion"
"tkestack.io/tke/api/notify"
"tkestack.io/tke/pkg/apiserver/authentication"
apiserverutil "tkestack.io/tke/pkg/apiserver/util"
messagerequeststrategy "tkestack.io/tke/pkg/notify/registry/messagerequest"
"tkestack.io/tke/pkg/notify/util"
Expand Down Expand Up @@ -109,9 +107,6 @@ func (r *REST) List(ctx context.Context, options *metainternal.ListOptions) (run
// DeleteCollection selects all resources in the storage matching given 'listOptions'
// and deletes them.
func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error) {
if !authentication.IsAdministrator(ctx, r.privilegedUsername) {
return nil, errors.NewMethodNotSupported(notify.Resource("messagerequests"), "delete collection")
}
return r.Store.DeleteCollection(ctx, deleteValidation, options, listOptions)
}

Expand Down
5 changes: 0 additions & 5 deletions pkg/notify/registry/receiver/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ package storage
import (
"context"

"k8s.io/apimachinery/pkg/api/errors"
metainternal "k8s.io/apimachinery/pkg/apis/meta/internalversion"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
genericregistry "k8s.io/apiserver/pkg/registry/generic"
"k8s.io/apiserver/pkg/registry/generic/registry"
"k8s.io/apiserver/pkg/registry/rest"
"tkestack.io/tke/api/notify"
"tkestack.io/tke/pkg/apiserver/authentication"
apiserverutil "tkestack.io/tke/pkg/apiserver/util"
receiverstrategy "tkestack.io/tke/pkg/notify/registry/receiver"
"tkestack.io/tke/pkg/notify/util"
Expand Down Expand Up @@ -100,9 +98,6 @@ func (r *REST) ShortNames() []string {
// DeleteCollection selects all resources in the storage matching given 'listOptions'
// and deletes them.
func (r *REST) DeleteCollection(ctx context.Context, deleteValidation rest.ValidateObjectFunc, options *metav1.DeleteOptions, listOptions *metainternal.ListOptions) (runtime.Object, error) {
if !authentication.IsAdministrator(ctx, r.privilegedUsername) {
return nil, errors.NewMethodNotSupported(notify.Resource("receivers"), "delete collection")
}
return r.Store.DeleteCollection(ctx, deleteValidation, options, listOptions)
}

Expand Down
Loading

0 comments on commit 79e2aba

Please sign in to comment.