Esempio n. 1
0
def create_space(name, namespace, **kwargs):  # pylint: disable=W0613
    # pylint: disable=E1120
    parent_tenant = tenant.get_tenant_from_namespace(
        tenant_namespace_name=namespace)
    parent_organization = parent_tenant.org
    space.ensure_space_resources(
        organization=parent_organization, tenant=parent_tenant, space_name=name)
Esempio n. 2
0
def space_mutator():
    request_info = request.get_json()
    parent_tenant = tenant.get_tenant_from_namespace(
        tenant_namespace_name=request_info["request"]["namespace"])
    parent_organization = parent_tenant.org
    patch = jsonpatch.JsonPatch([{
        "op": "add",
        "path": "/metadata/labels",
        "value": {
            "k8spin.cloud/org": parent_organization.metadata["name"],
            "k8spin.cloud/tenant": parent_tenant.metadata["name"],
            "k8spin.cloud/space": request_info["request"]["name"]
        }
    }])
    return mutator_response(True, "", patch)
Esempio n. 3
0
def create_space(name, namespace, **kwargs):
    parent_tenant = tenant.get_tenant_from_namespace(
        tenant_namespace_name=namespace)
    parent_organization = parent_tenant.org
    space.ensure_space_resources(
        organization=parent_organization, tenant=parent_tenant, space_name=name)