kube

package
v0.0.0-...-837e63c Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	LabelWorkspaceVisibility string = "workspaces.io/visibility"
)

Variables

This section is empty.

Functions

func NewCache

func NewCache(ctx context.Context, cfg *rest.Config, workspacesNamespace, kubesawNamespace string) (cache.Cache, error)

NewCache creates a controller-runtime cache.Cache instance configured to monitor spacebindings.toolchain.dev.openshift.com and workspaces.workspaces.io. IMPORTANT: returned cache needs to be started and initialized.

Types

type BuildClientFunc

type BuildClientFunc func(string) (client.Client, error)

func BuildClient

func BuildClient(config *rest.Config) BuildClientFunc

type ReadClient

type ReadClient struct {
	// contains filtered or unexported fields
}

ReadClient implements the WorkspaceLister and WorkspaceReader interfaces using a client.Reader as backend

func NewReadClientWithCache

func NewReadClientWithCache(ctx context.Context, cfg *rest.Config, workspacesNamespace, kubesawNamespace string) (*ReadClient, cache.Cache, error)

NewReadClientWithCache creates a controller-runtime cache and use it as KubeReadClient's backend.

func NewReadClientWithReader

func NewReadClientWithReader(backend client.Reader, workspacesNamespace, kubesawNamespace string) *ReadClient

NewReadClientWithReader creates a new KubeReadClient with the provided backend

func (*ReadClient) ListUserWorkspaces

func (c *ReadClient) ListUserWorkspaces(
	ctx context.Context,
	user string,
	objs *workspacesv1alpha1.WorkspaceList,
	opts ...client.ListOption,
) error

ListUserWorkspaces Returns all the workspaces the user has access to

func (*ReadClient) ReadUserWorkspace

func (c *ReadClient) ReadUserWorkspace(
	ctx context.Context,
	user string,
	owner string,
	space string,
	obj *workspacesv1alpha1.Workspace,
	opts ...client.GetOption,
) error

ReadUserWorkspace Returns the Workspace details only if the user has access to it

type WriteClient

type WriteClient struct {
	// contains filtered or unexported fields
}

func NewWriteClient

func NewWriteClient(buildClient BuildClientFunc, workspacesNamespace string) *WriteClient

func (*WriteClient) CreateUserWorkspace

func (c *WriteClient) CreateUserWorkspace(ctx context.Context, user string, workspace *workspacesv1alpha1.Workspace, opts ...client.CreateOption) error

func (*WriteClient) UpdateUserWorkspace

func (c *WriteClient) UpdateUserWorkspace(ctx context.Context, user string, workspace *workspacesv1alpha1.Workspace, opts ...client.UpdateOption) error

Jump to

Keyboard shortcuts

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