Documentation ¶
Index ¶
- type FakeDiscovery
- func (c *FakeDiscovery) OpenAPISchema() (*openapi_v2.Document, error)
- func (c *FakeDiscovery) RESTClient() restclient.Interface
- func (c *FakeDiscovery) ServerGroups() (*metav1.APIGroupList, error)
- func (c *FakeDiscovery) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error)
- func (c *FakeDiscovery) ServerPreferredResources() ([]*metav1.APIResourceList, error)
- func (c *FakeDiscovery) ServerResources() ([]*metav1.APIResourceList, error)
- func (c *FakeDiscovery) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error)
- func (c *FakeDiscovery) ServerVersion() (*version.Info, error)
- func (c *FakeDiscovery) SwaggerSchema(version schema.GroupVersion) (*swagger.ApiDeclaration, error)
- type RegeneratingDiscoveryRESTMapper
- func (m *RegeneratingDiscoveryRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
- func (m *RegeneratingDiscoveryRESTMapper) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error)
- func (m *RegeneratingDiscoveryRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error)
- func (m *RegeneratingDiscoveryRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error)
- func (m *RegeneratingDiscoveryRESTMapper) RegenerateMappings() error
- func (m *RegeneratingDiscoveryRESTMapper) ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error)
- func (m *RegeneratingDiscoveryRESTMapper) ResourceSingularizer(resource string) (singular string, err error)
- func (m *RegeneratingDiscoveryRESTMapper) ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error)
- func (m *RegeneratingDiscoveryRESTMapper) RunUntil(stop <-chan struct{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeDiscovery ¶
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 ¶
func (m *RegeneratingDiscoveryRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
KindFor takes a partial resource and returns back the single match. It returns an error if there are multiple matches.
func (*RegeneratingDiscoveryRESTMapper) KindsFor ¶
func (m *RegeneratingDiscoveryRESTMapper) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error)
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 ¶
func (m *RegeneratingDiscoveryRESTMapper) ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error)
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 ¶
func (m *RegeneratingDiscoveryRESTMapper) ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error)
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.