disk

package
v0.26.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedDiscoveryClient

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

CachedDiscoveryClient implements the functions that discovery server-supported API groups, versions and resources.

func NewCachedDiscoveryClientForConfig

func NewCachedDiscoveryClientForConfig(config *restclient.Config, discoveryCacheDir, httpCacheDir string, ttl time.Duration) (*CachedDiscoveryClient, error)

NewCachedDiscoveryClientForConfig creates a new DiscoveryClient for the given config, and wraps the created client in a CachedDiscoveryClient. The provided configuration is updated with a custom transport that understands cache responses. We receive two distinct cache directories for now, in order to preserve old behavior which makes use of the --cache-dir flag value for storing cache data from the CacheRoundTripper, and makes use of the hardcoded destination (~/.kube/cache/discovery/...) for storing CachedDiscoveryClient cache data. If httpCacheDir is empty, the restconfig's transport will not be updated with a roundtripper that understands cache responses. If discoveryCacheDir is empty, cached server resource data will be looked up in the current directory.

func (*CachedDiscoveryClient) Fresh

func (d *CachedDiscoveryClient) Fresh() bool

Fresh is supposed to tell the caller whether or not to retry if the cache fails to find something (false = retry, true = no need to retry).

func (*CachedDiscoveryClient) Invalidate

func (d *CachedDiscoveryClient) Invalidate()

Invalidate enforces that no cached data is used in the future that is older than the current time.

func (*CachedDiscoveryClient) OpenAPISchema

func (d *CachedDiscoveryClient) OpenAPISchema() (*openapi_v2.Document, error)

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

func (*CachedDiscoveryClient) OpenAPIV3

func (d *CachedDiscoveryClient) OpenAPIV3() openapi.Client

OpenAPIV3 retrieves and parses the OpenAPIV3 specs exposed by the server

func (*CachedDiscoveryClient) RESTClient

func (d *CachedDiscoveryClient) RESTClient() restclient.Interface

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

func (*CachedDiscoveryClient) ServerGroups

func (d *CachedDiscoveryClient) ServerGroups() (*metav1.APIGroupList, error)

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

func (*CachedDiscoveryClient) ServerGroupsAndResources

func (d *CachedDiscoveryClient) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav1.APIResourceList, error)

ServerGroupsAndResources returns the supported groups and resources for all groups and versions.

func (*CachedDiscoveryClient) ServerPreferredNamespacedResources

func (d *CachedDiscoveryClient) ServerPreferredNamespacedResources() ([]*metav1.APIResourceList, error)

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

func (*CachedDiscoveryClient) ServerPreferredResources

func (d *CachedDiscoveryClient) ServerPreferredResources() ([]*metav1.APIResourceList, error)

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

func (*CachedDiscoveryClient) ServerResourcesForGroupVersion

func (d *CachedDiscoveryClient) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error)

ServerResourcesForGroupVersion returns the supported resources for a group and version.

func (*CachedDiscoveryClient) ServerVersion

func (d *CachedDiscoveryClient) ServerVersion() (*version.Info, error)

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

func (*CachedDiscoveryClient) WithLegacy

WithLegacy returns current cached discovery client; current client does not support legacy-only discovery.

Jump to

Keyboard shortcuts

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