Skip to main content

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​

NameTypeDescription
podTemplate*v1.PodTemplateThe 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 if not found. This method allows retrieval of a specific PodTemplate or provides a fallback if the requested template does not exist.

Parameters​

NameTypeDescription
namespacestringThe namespace of the PodTemplate to load.
podTemplateNamestringThe name of the PodTemplate to load.

Returns​

TypeDescription
*v1.PodTemplateThe 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​

NameTypeDescription
namespacestringThe string representing the new default namespace to be set.

Store()​

@classmethod
def Store(
podTemplate: *v1.PodTemplate
)

Stores a PodTemplate in the internal mapping, associating it with its namespace. This method adds or updates a PodTemplate, making it available for retrieval.

Parameters​

NameTypeDescription
podTemplate*v1.PodTemplateThe PodTemplate object to be stored. Its name and namespace fields are used as the key for storage.