Documentation ¶
Index ¶
- func CreateOrUpdateFromHandler(ctx context.Context, namespace, input string, ...) ([]string, error)
- type AccessError
- type AccessKey
- type DynamicCache
- func (dc *DynamicCache) Create(ctx context.Context, object *unstructured.Unstructured) error
- func (dc *DynamicCache) CreateOrUpdateFromYAML(ctx context.Context, namespace, input string) ([]string, error)
- func (dc *DynamicCache) Delete(ctx context.Context, key store.Key) error
- func (dc *DynamicCache) Get(ctx context.Context, key store.Key) (*unstructured.Unstructured, error)
- func (dc *DynamicCache) IsLoading(ctx context.Context, key store.Key) bool
- func (dc *DynamicCache) List(ctx context.Context, key store.Key) (*unstructured.UnstructuredList, bool, error)
- func (dc *DynamicCache) RegisterOnUpdate(fn store.UpdateFn)
- func (dc *DynamicCache) Unwatch(ctx context.Context, groupVersionKinds ...schema.GroupVersionKind) error
- func (dc *DynamicCache) Update(ctx context.Context, key store.Key, ...) error
- func (dc *DynamicCache) UpdateClusterClient(ctx context.Context, client cluster.ClientInterface) error
- func (dc *DynamicCache) Watch(ctx context.Context, key store.Key, handler kcache.ResourceEventHandler) error
- type DynamicCacheOpt
- type InformerFactory
- type ResourceAccess
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOrUpdateFromHandler ¶ added in v0.15.0
func CreateOrUpdateFromHandler( ctx context.Context, namespace, input string, get func(context.Context, store.Key) (*unstructured.Unstructured, error), create func(context.Context, *unstructured.Unstructured) error, clusterClient cluster.ClientInterface, ) ([]string, error)
Types ¶
type AccessError ¶
type AccessError struct {
Key AccessKey
}
func (*AccessError) Error ¶
func (ae *AccessError) Error() string
type AccessKey ¶
AccessKey is used at a key in an access map. It is made up of a Namespace, Group, Resource, and Verb.
type DynamicCache ¶
type DynamicCache struct {
// contains filtered or unexported fields
}
DynamicCache is a cache based on the dynamic shared informer factory.
func NewDynamicCache ¶
func NewDynamicCache(ctx context.Context, client cluster.ClientInterface, options ...DynamicCacheOpt) (*DynamicCache, error)
NewDynamicCache creates an instance of DynamicCache.
func (*DynamicCache) Create ¶ added in v0.12.0
func (dc *DynamicCache) Create(ctx context.Context, object *unstructured.Unstructured) error
Create creates an object in the cluster. Note: test coverage of DynamicCache is slim.
func (*DynamicCache) CreateOrUpdateFromYAML ¶ added in v0.15.0
func (dc *DynamicCache) CreateOrUpdateFromYAML(ctx context.Context, namespace, input string) ([]string, error)
CreateOrUpdateFromYAML creates resources in the cluster from YAML input. Resources are created in the order they are present in the YAML. An error creating a resource halts resource creation. A list of created resources is returned. You may have created resources AND a non-nil error.
func (*DynamicCache) Get ¶
func (dc *DynamicCache) Get(ctx context.Context, key store.Key) (*unstructured.Unstructured, error)
Get retrieves a single object.
func (*DynamicCache) List ¶
func (dc *DynamicCache) List(ctx context.Context, key store.Key) (*unstructured.UnstructuredList, bool, error)
List lists objects.
func (*DynamicCache) RegisterOnUpdate ¶
func (dc *DynamicCache) RegisterOnUpdate(fn store.UpdateFn)
RegisterOnUpdate registers a function that will be called when the store updates it's client. TODO: investigate if this needed since object store isn't replaced, it's client is. (GH#496)
func (*DynamicCache) Unwatch ¶
func (dc *DynamicCache) Unwatch(ctx context.Context, groupVersionKinds ...schema.GroupVersionKind) error
Unwatch un-watches a key by stopping it's informer.
func (*DynamicCache) Update ¶
func (dc *DynamicCache) Update(ctx context.Context, key store.Key, updater func(*unstructured.Unstructured) error) error
func (*DynamicCache) UpdateClusterClient ¶
func (dc *DynamicCache) UpdateClusterClient(ctx context.Context, client cluster.ClientInterface) error
UpdateClusterClient updates the cluster client.
func (*DynamicCache) Watch ¶
func (dc *DynamicCache) Watch(ctx context.Context, key store.Key, handler kcache.ResourceEventHandler) error
Watch watches the cluster for an event and performs actions with the supplied handler.
type DynamicCacheOpt ¶
type DynamicCacheOpt func(*DynamicCache)
DynamicCacheOpt is an option for configuration DynamicCache.
func Access ¶
func Access(resourceAccess ResourceAccess) DynamicCacheOpt
Access sets the Resource Access cache for a DynamicCache.
type InformerFactory ¶
type InformerFactory interface { ForResource(gvr schema.GroupVersionKind) (informers.GenericInformer, error) Delete(gvr schema.GroupVersionKind) WaitForCacheSync(stopCh <-chan struct{}) map[schema.GroupVersionKind]bool }
InformerFactory creates informers.
type ResourceAccess ¶
type ResourceAccess interface { HasAccess(context.Context, store.Key, string) error Reset() Get(AccessKey) (bool, bool) Set(AccessKey, bool) UpdateClient(client cluster.ClientInterface) }
func NewResourceAccess ¶
func NewResourceAccess(client cluster.ClientInterface) ResourceAccess