helper

package
v3.4.1-beta.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MPL-2.0 Imports: 20 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanAccessInstance

func CanAccessInstance(managementClient kube.Interface, namespace, name string, resource string) (bool, error)

func CanAccessProjectSecret

func CanAccessProjectSecret(managementClient kube.Interface, namespace, name string) (bool, error)

func CanAccessSpaceInstance

func CanAccessSpaceInstance(managementClient kube.Interface, namespace, name string) (bool, error)

func CanAccessVirtualClusterInstance

func CanAccessVirtualClusterInstance(managementClient kube.Interface, namespace, name string) (bool, error)

func GetCurrentUser

func GetCurrentUser(ctx context.Context, managementClient kube.Interface) (*managementv1.UserInfo, *clusterv1.EntityInfo, error)

func SelectCluster

func SelectCluster(baseClient client.Client, log log.Logger) (string, error)

SelectCluster lets the user select a cluster

func SelectProjectCluster

func SelectProjectCluster(baseClient client.Client, project *managementv1.Project, log log.Logger) (string, error)

SelectProjectCluster lets the user select a cluster from the project's allowed clusters

func SelectProjectOrCluster

func SelectProjectOrCluster(baseClient client.Client, clusterName, projectName string, allowClusterOnly bool, log log.Logger) (cluster string, project string, err error)

func SelectSpaceAndClusterName

func SelectSpaceAndClusterName(baseClient client.Client, spaceName, clusterName string, log log.Logger) (string, string, error)

SelectSpaceAndClusterName selects a space and cluster name

func SelectSpaceInstanceOrSpace

func SelectSpaceInstanceOrSpace(baseClient client.Client, spaceName, projectName, clusterName string, log log.Logger) (string, string, string, error)

func SelectSpaceTemplate

func SelectSpaceTemplate(baseClient client.Client, projectName, templateName string, log log.Logger) (*managementv1.SpaceTemplate, error)

func SelectUserOrTeam

func SelectUserOrTeam(baseClient client.Client, clusterName string, log log.Logger) (*clusterv1.EntityInfo, *clusterv1.EntityInfo, error)

SelectUserOrTeam lets the user select an user or team in a cluster

func SelectVirtualClusterAndSpaceAndClusterName

func SelectVirtualClusterAndSpaceAndClusterName(baseClient client.Client, virtualClusterName, spaceName, clusterName string, log log.Logger) (string, string, string, error)

func SelectVirtualClusterInstanceOrVirtualCluster

func SelectVirtualClusterInstanceOrVirtualCluster(baseClient client.Client, virtualClusterName, spaceName, projectName, clusterName string, log log.Logger) (string, string, string, string, error)

func SelectVirtualClusterTemplate

func SelectVirtualClusterTemplate(baseClient client.Client, projectName, templateName string, log log.Logger) (*managementv1.VirtualClusterTemplate, error)

Types

type ClusterSpace

type ClusterSpace struct {
	clusterv1.Space
	Cluster string
}

func GetSpaces

func GetSpaces(baseClient client.Client, log log.Logger) ([]ClusterSpace, error)

GetSpaces returns all spaces accessible by the user or team

type ClusterUserOrTeam

type ClusterUserOrTeam struct {
	Team          bool
	ClusterMember managementv1.ClusterMember
}

func SelectClusterUserOrTeam

func SelectClusterUserOrTeam(baseClient client.Client, clusterName, userName, teamName string, log log.Logger) (*ClusterUserOrTeam, error)

type ClusterVirtualCluster

type ClusterVirtualCluster struct {
	clusterv1.VirtualCluster
	Cluster string
}

func GetVirtualClusters

func GetVirtualClusters(baseClient client.Client, log log.Logger) ([]ClusterVirtualCluster, error)

GetVirtualClusters returns all virtual clusters the user has access to

type ProjectProjectSecret

type ProjectProjectSecret struct {
	ProjectSecret managementv1.ProjectSecret
	Project       string
}

func GetProjectSecrets

func GetProjectSecrets(ctx context.Context, managementClient kube.Interface, projectNames ...string) ([]*ProjectProjectSecret, error)

type ProjectSpace

type ProjectSpace struct {
	SpaceInstance managementv1.SpaceInstance
	Project       string
}

func GetSpaceInstances

func GetSpaceInstances(baseClient client.Client) ([]ProjectSpace, error)

type ProjectVirtualCluster

type ProjectVirtualCluster struct {
	VirtualClusterInstance managementv1.VirtualClusterInstance
	Project                string
}

func GetVirtualClusterInstances

func GetVirtualClusterInstances(baseClient client.Client) ([]ProjectVirtualCluster, error)

type SpaceInstanceProject

type SpaceInstanceProject struct {
	Space   *managementv1.SpaceInstance
	Project *managementv1.Project
}

type VirtualClusterInstanceProject

type VirtualClusterInstanceProject struct {
	VirtualCluster *managementv1.VirtualClusterInstance
	Project        *managementv1.Project
}

Jump to

Keyboard shortcuts

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