dynamicmapper

package
v0.0.0-...-c1fcc63 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeDiscovery

type FakeDiscovery struct {
	*testing.Fake
}

FakeDiscovery is a fake implementation of DiscoveryClient.

func (*FakeDiscovery) OpenAPISchema

func (c *FakeDiscovery) OpenAPISchema() (*openapi_v2.Document, error)

OpenAPISchema fetches the open api schema using a rest client and parses the proto.

func (*FakeDiscovery) RESTClient

func (c *FakeDiscovery) RESTClient() restclient.Interface

RESTClient returns a RESTClient that is used to communicate with API server by this client implementation.

func (*FakeDiscovery) ServerGroups

func (c *FakeDiscovery) ServerGroups() (*metav1.APIGroupList, error)

ServerGroups returns the supported groups, with information like supported versions and the preferred version.

func (*FakeDiscovery) ServerPreferredNamespacedResources

func (c *FakeDiscovery) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error)

ServerPreferredNamespacedResources returns the supported namespaced resources with the version preferred by the server.

func (*FakeDiscovery) ServerPreferredResources

func (c *FakeDiscovery) ServerPreferredResources() ([]*metav1.APIResourceList, error)

ServerPreferredResources returns the supported resources with the version preferred by the server.

func (*FakeDiscovery) ServerResources

func (c *FakeDiscovery) ServerResources() ([]*metav1.APIResourceList, error)

ServerResources returns the supported resources for all groups and versions.

func (*FakeDiscovery) ServerResourcesForGroupVersion

func (c *FakeDiscovery) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error)

ServerResourcesForGroupVersion returns the supported resources for a group and version.

func (*FakeDiscovery) ServerVersion

func (c *FakeDiscovery) ServerVersion() (*version.Info, error)

ServerVersion retrieves and parses the server's version (git version).

func (*FakeDiscovery) SwaggerSchema

func (c *FakeDiscovery) SwaggerSchema(version schema.GroupVersion) (*swagger.ApiDeclaration, error)

SwaggerSchema retrieves and parses the swagger API schema the server supports.

type RegeneratingDiscoveryRESTMapper

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

RegeneratingDiscoveryRESTMapper is a RESTMapper which Regenerates its cache of mappings periodically. It functions by recreating a normal discovery RESTMapper at the specified interval. We don't refresh automatically on cache misses, since we get called on every label, plenty of which will be unrelated to Kubernetes resources.

func NewRESTMapper

func NewRESTMapper(discoveryClient discovery.DiscoveryInterface, versionInterfaces meta.VersionInterfacesFunc, refreshInterval time.Duration) (*RegeneratingDiscoveryRESTMapper, error)

NewRESTMapper creates RegeneratingDiscoveryRESTMapper.

func (*RegeneratingDiscoveryRESTMapper) KindFor

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

func (*RegeneratingDiscoveryRESTMapper) KindsFor

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

func (*RegeneratingDiscoveryRESTMapper) RESTMapping

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

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

func (*RegeneratingDiscoveryRESTMapper) RESTMappings

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

RESTMappings returns the RESTMappings for the provided group kind in a rough internal preferred order. If no kind is found, it will return a NoResourceMatchError.

func (*RegeneratingDiscoveryRESTMapper) RegenerateMappings

func (m *RegeneratingDiscoveryRESTMapper) RegenerateMappings() error

RegenerateMappings regenerates cached mappings.

func (*RegeneratingDiscoveryRESTMapper) ResourceFor

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

func (*RegeneratingDiscoveryRESTMapper) ResourceSingularizer

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

ResourceSingularizer converts a resource name from plural to singular (e.g., from pods to pod).

func (*RegeneratingDiscoveryRESTMapper) ResourcesFor

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

func (*RegeneratingDiscoveryRESTMapper) RunUntil

func (m *RegeneratingDiscoveryRESTMapper) RunUntil(stop <-chan struct{})

RunUntil runs the mapping refresher until the given stop channel is closed.

Jump to

Keyboard shortcuts

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