Skip to content

Commit

Permalink
Merge pull request #2629 from fgiloux/admission-cleanup
Browse files Browse the repository at this point in the history
🌱 Admission cleanup
  • Loading branch information
openshift-merge-robot authored Jan 17, 2023
2 parents 33064b5 + 733bcf1 commit 8927e9d
Showing 1 changed file with 0 additions and 10 deletions.
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,
})
}

0 comments on commit 8927e9d

Please sign in to comment.