K8sCacheWrapper
No overview available.
Attributes
| Attribute | Type | Description |
|---|---|---|
| Cache | cache.Cache | This field embeds the cache.Cache interface, providing the K8sCacheWrapper with all the methods and fields defined in the cache.Cache interface, allowing it to function as a cache. |
Methods
Get()
@classmethod
def Get(
ctx: context.Context,
key: client.ObjectKey,
obj: client.Object,
opts: client.GetOption
) - > error
Fetches a single Kubernetes object from the cache using its key. Callers use this to retrieve the current state of a specific resource.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the request, used for cancellation and deadlines. |
| key | client.ObjectKey | The key identifying the Kubernetes object to retrieve, typically containing its name and namespace. |
| obj | client.Object | The object to populate with the retrieved data. This should be a pointer to a Kubernetes API type (e.g., *corev1.Pod). |
| opts | client.GetOption | Optional parameters for the get operation, such as specifying a field selector. |
Returns
| Type | Description |
|---|---|
error | An error if the object could not be retrieved, otherwise nil. |
List()
@classmethod
def List(
ctx: context.Context,
list: client.ObjectList,
opts: client.ListOption
) - > error
Lists multiple Kubernetes objects of a specific type from the cache. Callers use this to retrieve collections of resources that match certain criteria.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the request, used for cancellation and deadlines. |
| list | client.ObjectList | The list object to populate with the retrieved data. This should be a pointer to a Kubernetes API list type (e.g., *corev1.PodList). |
| opts | client.ListOption | Optional parameters for the list operation, such as namespace, labels, or field selectors. |
Returns
| Type | Description |
|---|---|
error | An error if the list operation failed, otherwise nil. |