kosmo

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DeploymentGVK = schema.GroupVersionKind{
		Group:   appsv1.GroupName,
		Version: "v1",
		Kind:    "Deployment",
	}
	ServiceGVK = schema.GroupVersionKind{
		Group:   corev1.GroupName,
		Version: "v1",
		Kind:    "Service",
	}
	IngressGVK = schema.GroupVersionKind{
		Group:   netv1.GroupName,
		Version: "v1",
		Kind:    "Ingress",
	}
)
View Source
var (
	ErrNoItems = errors.New("no items")
)

Functions

func BytesEqual

func BytesEqual(a, b []byte) bool

func LooseDeepEqual

func LooseDeepEqual(x, y Comparable, opts ...deepEqualOption) bool

LooseDeepEqual deep equal objects without dynamic values This function removes some fields, so you should give deep-copied objects.

func PodStatusReason

func PodStatusReason(pod corev1.Pod) string

func WithPrintDiff

func WithPrintDiff() deepEqualOption

Types

type Client

type Client struct {
	client.Client
}

func NewClient

func NewClient(c client.Client) Client

func NewClientByRestConfig

func NewClientByRestConfig(cfg *rest.Config, scheme *runtime.Scheme) (Client, error)

func (*Client) Apply

func (c *Client) Apply(ctx context.Context, obj *unstructured.Unstructured, fieldManager string, dryrun, force bool) (patched *unstructured.Unstructured, err error)

func (*Client) GetDefaultPassword

func (c *Client) GetDefaultPassword(ctx context.Context, userid string) (*string, error)

func (*Client) GetInstance

func (c *Client) GetInstance(ctx context.Context, name, namespace string) (*cosmov1alpha1.Instance, error)

func (*Client) GetTemplate

func (c *Client) GetTemplate(ctx context.Context, tmplName string) (*cosmov1alpha1.Template, error)

func (*Client) GetUnstructured

func (c *Client) GetUnstructured(ctx context.Context, gvk schema.GroupVersionKind, name, namespace string) (*unstructured.Unstructured, error)

func (*Client) GetUser

func (c *Client) GetUser(ctx context.Context, name string) (*wsv1alpha1.User, error)

func (*Client) GetWorkspace

func (c *Client) GetWorkspace(ctx context.Context, name, namespace string) (*wsv1alpha1.Workspace, error)

func (*Client) GetWorkspaceByUserID

func (c *Client) GetWorkspaceByUserID(ctx context.Context, name, userid string) (*wsv1alpha1.Workspace, error)

func (*Client) GetWorkspaceConfig

func (c *Client) GetWorkspaceConfig(ctx context.Context, tmplName string) (cfg wsv1alpha1.Config, err error)

func (*Client) GetWorkspaceServicesAndIngress

func (c *Client) GetWorkspaceServicesAndIngress(ctx context.Context, ws wsv1alpha1.Workspace) (svc corev1.Service, ing netv1.Ingress, err error)

func (*Client) IsDefaultPassword

func (c *Client) IsDefaultPassword(ctx context.Context, userid string) (bool, error)

func (*Client) ListInstances

func (c *Client) ListInstances(ctx context.Context, namespace string) ([]cosmov1alpha1.Instance, error)

func (*Client) ListInstancesByType

func (c *Client) ListInstancesByType(ctx context.Context, namespace string, types []string) ([]cosmov1alpha1.Instance, error)

func (*Client) ListTemplates

func (c *Client) ListTemplates(ctx context.Context) ([]cosmov1alpha1.Template, error)

func (*Client) ListTemplatesByType

func (c *Client) ListTemplatesByType(ctx context.Context, tmplTypes []string) ([]cosmov1alpha1.Template, error)

func (*Client) ListUsers

func (c *Client) ListUsers(ctx context.Context) ([]wsv1alpha1.User, error)

func (*Client) ListWorkspacePods

func (c *Client) ListWorkspacePods(ctx context.Context, ws wsv1alpha1.Workspace) ([]corev1.Pod, error)

func (*Client) ListWorkspaces

func (c *Client) ListWorkspaces(ctx context.Context, namespace string) ([]wsv1alpha1.Workspace, error)

func (*Client) ListWorkspacesByUserID

func (c *Client) ListWorkspacesByUserID(ctx context.Context, userid string) ([]wsv1alpha1.Workspace, error)

func (*Client) RegisterPassword

func (c *Client) RegisterPassword(ctx context.Context, userid string, password []byte) error

func (*Client) ResetPassword

func (c *Client) ResetPassword(ctx context.Context, userid string) error

func (*Client) VerifyPassword

func (c *Client) VerifyPassword(ctx context.Context, userid string, pass []byte) (verified bool, isDefault bool, err error)

type Comparable

type Comparable interface {
	GetManagedFields() []metav1.ManagedFieldsEntry
	SetManagedFields(managedFields []metav1.ManagedFieldsEntry)
	SetResourceVersion(resourceVersion string)
}

Jump to

Keyboard shortcuts

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