Merge pull request #127663 from alexanderstephan/export-reflector

Export name and typeDescription members of reflector struct

Kubernetes-commit: 95ec69c16c76b5ee71fdbebc7a5dea2c39341eb3
This commit is contained in:
Kubernetes Publisher 2024-10-09 00:16:22 +01:00
commit ba20fcad8f
3 changed files with 12 additions and 4 deletions

2
go.mod
View File

@ -27,7 +27,7 @@ require (
google.golang.org/protobuf v1.34.2
gopkg.in/evanphx/json-patch.v4 v4.12.0
k8s.io/api v0.0.0-20241007141734-f2b3dfac9f9a
k8s.io/apimachinery v0.0.0-20241004115029-c463db196543
k8s.io/apimachinery v0.0.0-20241008174842-acfda137309f
k8s.io/klog/v2 v2.130.1
k8s.io/kube-openapi v0.0.0-20240827152857-f7e401e7b4c2
k8s.io/utils v0.0.0-20240711033017-18e509b52bc8

4
go.sum
View File

@ -157,8 +157,8 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
k8s.io/api v0.0.0-20241007141734-f2b3dfac9f9a h1:8q3QPAbWPx++17jOoJM531vGG++BaX6gtqbDE0+Ris8=
k8s.io/api v0.0.0-20241007141734-f2b3dfac9f9a/go.mod h1:4imq7dQloEla0ISqR4MeHpt7KNQ/IbLuRQM6skmjopE=
k8s.io/apimachinery v0.0.0-20241004115029-c463db196543 h1:CGv23f9CJ4us75c23ziAVpdkPgJj63aFkKlD0jTl/AI=
k8s.io/apimachinery v0.0.0-20241004115029-c463db196543/go.mod h1:5rKPDwwN9qm//xASFCZ83nyYEanHxxhc7pZ8AC4lukY=
k8s.io/apimachinery v0.0.0-20241008174842-acfda137309f h1:H2ZYi+KurPHzI6h2BZo8c/jMt9Qj450Hrhkxz4u24X4=
k8s.io/apimachinery v0.0.0-20241008174842-acfda137309f/go.mod h1:5rKPDwwN9qm//xASFCZ83nyYEanHxxhc7pZ8AC4lukY=
k8s.io/klog/v2 v2.130.1 h1:n9Xl7H1Xvksem4KFG4PYbdQCQxqc/tTUyrgXaOhHSzk=
k8s.io/klog/v2 v2.130.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20240827152857-f7e401e7b4c2 h1:GKE9U8BH16uynoxQii0auTjmmmuZ3O0LFMN6S0lPPhI=

View File

@ -57,7 +57,7 @@ var (
// Reflector watches a specified resource and causes all changes to be reflected in the given store.
type Reflector struct {
// name identifies this reflector. By default it will be a file:line if possible.
// name identifies this reflector. By default, it will be a file:line if possible.
name string
// The name of the type we expect to place in the store. The name
// will be the stringification of expectedGVK if provided, and the
@ -121,6 +121,14 @@ type Reflector struct {
UseWatchList *bool
}
func (r *Reflector) GetName() string {
return r.name
}
func (r *Reflector) GetTypeDescription() string {
return r.typeDescription
}
// ResourceVersionUpdater is an interface that allows store implementation to
// track the current resource version of the reflector. This is especially
// important if storage bookmarks are enabled.