Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌱 Admission cleanup #2629

Merged
merged 2 commits into from
Jan 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions pkg/admission/apibinding/apibinding_admission.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import (
"github.com/kcp-dev/kcp/pkg/apis/core"
"github.com/kcp-dev/kcp/pkg/authorization/delegated"
kcpinformers "github.com/kcp-dev/kcp/pkg/client/informers/externalversions"
apisv1alpha1listers "github.com/kcp-dev/kcp/pkg/client/listers/apis/v1alpha1"
"github.com/kcp-dev/kcp/pkg/indexers"
)

Expand Down Expand Up @@ -70,7 +69,6 @@ type apiBindingAdmission struct {

getAPIExport func(path logicalcluster.Path, name string) (*apisv1alpha1.APIExport, error)

apiExportLister apisv1alpha1listers.APIExportClusterLister
apiExportIndexer cache.Indexer

deepSARClient kcpkubernetesclientset.ClusterInterface
Expand Down Expand Up @@ -280,9 +278,6 @@ func (o *apiBindingAdmission) ValidateInitialization() error {
if o.deepSARClient == nil {
return fmt.Errorf(PluginName + " plugin needs a deepSARClient")
}
if o.apiExportLister == nil {
return fmt.Errorf(PluginName + " plugin needs an APIExport lister")
}
return nil
}

Expand All @@ -297,10 +292,5 @@ func (o *apiBindingAdmission) SetKcpInformers(local, global kcpinformers.SharedI
o.SetReadyFunc(func() bool {
return apiExportsReady()
})
o.apiExportLister = local.Apis().V1alpha1().APIExports().Lister()
o.apiExportIndexer = local.Apis().V1alpha1().APIExports().Informer().GetIndexer()

indexers.AddIfNotPresentOrDie(local.Tenancy().V1alpha1().WorkspaceTypes().Informer().GetIndexer(), cache.Indexers{
indexers.ByLogicalClusterPathAndName: indexers.IndexByLogicalClusterPathAndName,
})
}