PodTemplateStore
This class maintains a thread-safe mapping of active PodTemplates with their associated namespaces.
Methods
Delete()
@classmethod
def Delete(
podTemplate: *v1.PodTemplate
)
Deletes a PodTemplate from the store. This method removes the specified PodTemplate, identified by its name and namespace, from the internal mapping.
Parameters
| Name | Type | Description |
|---|---|---|
| podTemplate | *v1.PodTemplate | The PodTemplate object to be deleted from the store. Its name and namespace fields are used for identification. |
LoadOrDefault()
@classmethod
def LoadOrDefault(
namespace: string,
podTemplateName: string
) - > *v1.PodTemplate
Loads a PodTemplate from the store based on its namespace and name, or returns a default PodTemplate if not found. This method allows retrieval of a specific PodTemplate or provides a fallback if the requested template does not exist.
Parameters
| Name | Type | Description |
|---|---|---|
| namespace | string | The namespace of the PodTemplate to load. |
| podTemplateName | string | The name of the PodTemplate to load. |
Returns
| Type | Description |
|---|---|
*v1.PodTemplate | The requested PodTemplate if found, otherwise a default PodTemplate. |
SetDefaultNamespace()
@classmethod
def SetDefaultNamespace(
namespace: string
)
Sets the default namespace for the PodTemplateStore. This method configures the namespace that will be used when operations do not explicitly specify one.
Parameters
| Name | Type | Description |
|---|---|---|
| namespace | string | The string representing the default namespace to be set. |
Store()
@classmethod
def Store(
podTemplate: *v1.PodTemplate
)
Stores a PodTemplate in the map, associating it with its namespace. This method adds or updates a PodTemplate in the internal thread-safe mapping.
Parameters
| Name | Type | Description |
|---|---|---|
| podTemplate | *v1.PodTemplate | The PodTemplate object to be stored or updated in the map. |