FileserverBuilder

class controller.services.builder.fileserver.FileserverBuilder(*, config, base_url, volumes, logger)

Bases: object

Construct Kubernetes objects for user file servers.

Parameters:

Methods Summary

build(user)

Construct the objects that make up a user's fileserver.

build_name(username)

Construct the name of fileserver objects.

get_username_for_pod(pod)

Determine the username for a file server pod.

is_valid(username, state)

Determine whether a running fileserver is valid.

Methods Documentation

build(user)

Construct the objects that make up a user’s fileserver.

Parameters:

user (GafaelfawrUserInfo) – User for whom to create a fileserver.

Returns:

Kubernetes objects for the fileserver.

Return type:

FileserverObjects

build_name(username)

Construct the name of fileserver objects.

Parameters:

username (str) – Username the fileserver is for.

Returns:

Name of all Kubernetes objects for that fileserver.

Return type:

str

get_username_for_pod(pod)

Determine the username for a file server pod.

Parameters:

pod (V1Pod) – Pod object.

Returns:

Username corresponding to that file server pod, or None if no username information could be found.

Return type:

str

is_valid(username, state)

Determine whether a running fileserver is valid.

Parameters:
  • username (str) – Username the fileserver is for, used for logging.

  • state (FileserverStateObjects) – Kubernetes objects making up the fileserver.

Returns:

True if the fileserver is valid and running, False otherwise.

Return type:

bool