controllerrestmapper

package
v1.6.4-pre.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg *rest.Config, httpClient *http.Client) (meta.RESTMapper, error)

New is the constructor for a ControllerRESTMapper

Types

type ControllerRESTMapper

type ControllerRESTMapper struct {
	// contains filtered or unexported fields
}

ControllerRESTMapper is a meta.RESTMapper that is optimized for controllers. It caches results in memory, and minimizes discovery because we don't need shortnames etc in controllers. Controllers primarily need to map from GVK -> GVR.

func (*ControllerRESTMapper) KindFor

KindFor takes a partial resource and returns the single match. Returns an error if there are multiple matches

func (*ControllerRESTMapper) KindsFor

KindsFor takes a partial resource and returns the list of potential kinds in priority order

func (*ControllerRESTMapper) RESTMapping

func (m *ControllerRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error)

RESTMapping identifies a preferred resource mapping for the provided group kind.

func (*ControllerRESTMapper) RESTMappings

func (m *ControllerRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error)

RESTMappings returns all resource mappings for the provided group kind if no version search is provided. Otherwise identifies a preferred resource mapping for the provided version(s).

func (*ControllerRESTMapper) ResourceFor

ResourceFor takes a partial resource and returns the single match. Returns an error if there are multiple matches

func (*ControllerRESTMapper) ResourceSingularizer

func (m *ControllerRESTMapper) ResourceSingularizer(resource string) (singular string, err error)

func (*ControllerRESTMapper) ResourcesFor

ResourcesFor takes a partial resource and returns the list of potential resource in priority order

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL