tenantnamespace

package
v1.0.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package tenantnamespace provides an interface, and its implementation, to handle the creation and the management of tenant namespaces

Index

Constants

View Source
const (
	// NamePrefix is the prefix of all tenant namespace names.
	NamePrefix = "liqo-tenant"
)

Variables

This section is empty.

Functions

func GetClusterIDFromTenantNamespace

func GetClusterIDFromTenantNamespace(namespace *corev1.Namespace) (liqov1beta1.ClusterID, error)

GetClusterIDFromTenantNamespace returns the cluster ID of the cluster that owns the given tenant namespace.

func GetNameForNamespace added in v0.4.0

func GetNameForNamespace(cluster liqov1beta1.ClusterID) string

GetNameForNamespace given a cluster identity it returns the name of the tenant namespace for the cluster.

Types

type Manager

type Manager interface {
	CreateNamespace(ctx context.Context, cluster liqov1beta1.ClusterID) (*corev1.Namespace, error)
	ForgeNamespace(cluster liqov1beta1.ClusterID, name *string) *corev1.Namespace
	GetNamespace(ctx context.Context, cluster liqov1beta1.ClusterID) (*corev1.Namespace, error)
	BindClusterRoles(ctx context.Context, cluster liqov1beta1.ClusterID,
		owner metav1.Object, clusterRoles ...*rbacv1.ClusterRole) ([]*rbacv1.RoleBinding, error)
	UnbindClusterRoles(ctx context.Context, cluster liqov1beta1.ClusterID, clusterRoles ...string) error
	BindClusterRolesClusterWide(ctx context.Context, cluster liqov1beta1.ClusterID,
		owner metav1.Object, clusterRoles ...*rbacv1.ClusterRole) ([]*rbacv1.ClusterRoleBinding, error)
	UnbindClusterRolesClusterWide(ctx context.Context, cluster liqov1beta1.ClusterID, clusterRoles ...string) error
}

Manager provides the methods to handle the creation and the management of tenant namespaces.

func NewCachedManager added in v0.5.3

func NewCachedManager(ctx context.Context, client kubernetes.Interface, scheme *runtime.Scheme) Manager

NewCachedManager creates a new TenantNamespaceManager object, supporting cached retrieval of namespaces for increased efficiency.

func NewManager added in v0.5.3

func NewManager(client kubernetes.Interface, scheme *runtime.Scheme) Manager

NewManager creates a new TenantNamespaceManager object.

Jump to

Keyboard shortcuts

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