tenancy

package
v0.9.1-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2022 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTenants

func CreateTenants(ctx context.Context, tenants []Tenant, c client.Client) error

CreateTenants creates resources for tenants given a file for definition.

func ExportTenants

func ExportTenants(tenants []Tenant, out io.Writer) error

ExportTenants exports all the tenants to a file.

func GenerateTenantResources

func GenerateTenantResources(tenants ...Tenant) ([]runtime.Object, error)

GenerateTenantResources creates all the resources for tenants.

Types

type Tenant

type Tenant struct {
	Name        string            `yaml:"name"`
	Namespaces  []string          `yaml:"namespaces"`
	ClusterRole string            `yaml:"clusterRole"`
	Labels      map[string]string `yaml:"labels"`
}

Tenant represents a tenant that we generate resources for in the tenancy system.

func Parse

func Parse(filename string) ([]Tenant, error)

Parse a raw tenant declaration, and parses it from the YAML and returns the extracted Tenants.

func (Tenant) Validate

func (t Tenant) Validate() error

Validate returns an error if any of the fields isn't valid

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL