PYTEST_HELM_CHARTS.GIANTSWARM_APP_PLATFORM.APP
AppCR
— Baseclass for all Kubernetes API objects</>ConfiguredApp
— Class that represents application deployed by App CR and its optional configuration in ConfigMap.</>AppFactoryFunc
— Base class for protocol classes.</>
delete_app
(
configured_app
)
— Deletes the app created by create_app.</>make_app_object
(
kube_client
,app_name
,app_version
,catalog_name
,catalog_namespace
,namespace
,deployment_namespace
,config_values
,extra_metadata
,extra_spec
)
(ConfiguredApp) — Creates a new App object. Optionally creates a values ConfigMap. Objects are not sent to API server.</>wait_for_app_to_be_deleted
(
kube_client
,app_name
,app_namespace
,timeout_sec
)
(bool) — Block until an App CR has statusdeleted
or doesn't exist in k8s API.</>wait_for_apps_to_run
(
kube_client
,app_names
,app_namespace
,timeout_sec
,missing_ok
,fail_fast
)
(list of AppCR) — Block until all the apps are running or timeout is reached.</>
pytest_helm_charts.giantswarm_app_platform.app.
AppCR
(
api
, obj
)
Baseclass for all Kubernetes API objects
api
(HTTPClient) —obj
(dict) —
_original_obj
—annotations
(dict) — Annotations of the Kubernetes resource (metadata.annotations)
Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations</>api
—labels
(dict) — Labels of the Kubernetes resource (metadata.labels)
Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels</>name
(str) — Name of the Kubernetes resource (metadata.name)
Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names</>namespace
(str) — Namespace scope of the Kubernetes resource (metadata.namespace)
Namespace defines the space within each name must be unique. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces</>obj
—
delete
(
propagation_policy
)
— Delete the Kubernetes resource by calling the API.</>patch
(
strategic_merge_patch
,subresource
)
— Patch the Kubernetes resource by calling the API with a "strategic merge" patch.</>update
(
is_strategic
,subresource
)
— Update the Kubernetes resource by calling the API (patch)</>
patch
(
strategic_merge_patch
, subresource=None
)
Patch the Kubernetes resource by calling the API with a "strategic merge" patch.
strategic_merge_patch
—subresource
(optional) —
update
(
is_strategic=True
, subresource=None
)
Update the Kubernetes resource by calling the API (patch)
is_strategic
(optional) —subresource
(optional) —
delete
(
propagation_policy=None
)
Delete the Kubernetes resource by calling the API.
The parameter propagation_policy defines whether to cascade the delete. It can be "Foreground", "Background" or "Orphan". See https://kubernetes.io/docs/concepts/workloads/controllers/garbage-collection/#setting-the-cascading-deletion-policy
propagation_policy
(str, optional) —
pytest_helm_charts.giantswarm_app_platform.app.
ConfiguredApp
(
app
, app_cm
)
Class that represents application deployed by App CR and its optional configuration in ConfigMap.
app
(AppCR) —app_cm
(ConfigMap, optional) —
pytest_helm_charts.giantswarm_app_platform.app.
AppFactoryFunc
(
*args
, **kwds
)
Base class for protocol classes.
Protocol classes are defined as::
class Proto(Protocol):
def meth(self) -> int:
...
Such classes are primarily used with static type checkers that recognize structural subtyping (static duck-typing), for example::
class C:
def meth(self) -> int:
return 0
def func(x: Proto) -> int:
return x.meth()
func(C()) # Passes static type check
See PEP 544 for details. Protocol classes decorated with @typing.runtime_checkable act as simple-minded runtime protocols that check only the presence of given attributes, ignoring their type signatures. Protocol classes can be generic, they are defined as::
class GenProto(Protocol[T]):
def meth(self) -> T:
...
*args
—**kwds
—
_ProtocolMeta
— Metaclass for defining Abstract Base Classes (ABCs).</>
__init_subclass__
(
*args
,**kwargs
)
— This method is called when a class is subclassed.</>
typing.
_ProtocolMeta
(
name
, bases
, namespace
, **kwargs
)
Metaclass for defining Abstract Base Classes (ABCs).
Use this metaclass to create an ABC. An ABC can be subclassed directly, and then acts as a mix-in class. You can also register unrelated concrete classes (even built-in classes) and unrelated ABCs as 'virtual subclasses' -- these and their descendants will be considered subclasses of the registering ABC by the built-in issubclass() function, but the registering ABC won't show up in their MRO (Method Resolution Order) nor will method implementations defined by the registering ABC be callable (not even via super()).
name
—bases
—namespace
—**kwargs
—
__instancecheck__
(
cls
,instance
)
— Override for isinstance(instance, cls).</>__subclasscheck__
(
cls
,subclass
)
— Override for issubclass(subclass, cls).</>register
(
cls
,subclass
)
— Register a virtual subclass of an ABC.</>
register
(
cls
, subclass
)
Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
cls
—subclass
—
__subclasscheck__
(
cls
, subclass
)
Override for issubclass(subclass, cls).
cls
—subclass
—
__instancecheck__
(
cls
, instance
)
Override for isinstance(instance, cls).
cls
—instance
—
__init_subclass__
(
*args
, **kwargs
)
This method is called when a class is subclassed.
The default implementation does nothing. It may be overridden to extend subclasses.
*args
—**kwargs
—
pytest_helm_charts.giantswarm_app_platform.app.
wait_for_apps_to_run
(
kube_client
, app_names
, app_namespace
, timeout_sec
, missing_ok=False
, fail_fast=False
)
Block until all the apps are running or timeout is reached.
kube_client
(HTTPClient) — client to use to connect to the k8s clusterapp_names
(list of str) — a list of application names to check; all of the applications must be running for this function to succeedapp_namespace
(str) — namespace where the App CRs of all the apps are storedtimeout_sec
(int) — timeout for the callmissing_ok
(bool, optional) — whenTrue
, the function ignores that some of the apps listed in theapp_names
don't exist in k8s API and waits for them to show up; whenFalse
, an ObjectNotFound exception is raised.fail_fast
(bool, optional) — if set to True, the function fails as soon as the App reaches 'status=failed`, without waiting for any subsequent status changes.
The list of App CRs with all the apps listed in app_names
included.
ObjectStatusError
— when App object hasStatus: failed
status.TimeoutError
— when timeout is reached.pykube.exceptions.ObjectDoesNotExist
— whenmissing_ok == False
and one of the apps listed inapp_names
can't be found in k8s API
pytest_helm_charts.giantswarm_app_platform.app.
wait_for_app_to_be_deleted
(
kube_client
, app_name
, app_namespace
, timeout_sec
)
Block until an App CR has status deleted
or doesn't exist in k8s API.
kube_client
(HTTPClient) — client to use to connect to the k8s clusterapp_name
(str) — an application name to checkapp_namespace
(str) — namespace where all the App CRs are storedtimeout_sec
(int) — timeout for the call
True
when the App CR was found with status deleted
or was not found at all. False
otherwise.
TimeoutError
— when timeout is reached.
pytest_helm_charts.giantswarm_app_platform.app.
delete_app
(
configured_app
)
Deletes the app created by create_app.
configured_app
(ConfiguredApp) — ConfiguredApp (with optional ConfigMap configuration) to be deleted.
None
pytest_helm_charts.giantswarm_app_platform.app.
make_app_object
(
kube_client
, app_name
, app_version
, catalog_name
, catalog_namespace
, namespace
, deployment_namespace
, config_values=None
, extra_metadata=None
, extra_spec=None
)
Creates a new App object. Optionally creates a values ConfigMap. Objects are not sent to API server.
kube_client
(HTTPClient) — client to use to connect to the k8s clusterapp_name
(str) — name of the app in the app catalogapp_version
(str) — version of the app to use from the app catalogcatalog_name
(str) — a name of the catalog used for the CatalogCR; must already existcatalog_namespace
(str) — a namespace of the CatalogCRnamespace
(str) — namespace where the App CR will be createddeployment_namespace
(str) — namespace where the app will be deployed (can be different thannamespace
)config_values
(dict(str: any), optional) — any values that should be used to configure the app (same asvalues.yaml
used for a Helm Chart directly).extra_metadata
(dict, optional) — optional dict that will be merged with the 'metadata:' section of the objectextra_spec
(dict, optional) — optional dict that will be merged with the 'spec:' section of the object
The ConfiguredApp object that includes both AppCR and ConfigMap.