kosmo

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2021 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultServiceAccount = "default"
)

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 FillTypeMeta

func FillTypeMeta(obj GVKSetter, gv schema.GroupVersion)

FillTypeMeta fills typemeta to marshall yaml

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) CreateUser

func (c *Client) CreateUser(ctx context.Context, user *wsv1alpha1.User) (*wsv1alpha1.User, error)

func (*Client) DeleteUser

func (c *Client) DeleteUser(ctx context.Context, userid string, opts ...client.DeleteOption) (*wsv1alpha1.User, 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, userid string) (*wsv1alpha1.User, error)

func (*Client) GetUserNamespace

func (c *Client) GetUserNamespace(ctx context.Context, userid string) (*corev1.Namespace, 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) UpdateUser

func (c *Client) UpdateUser(ctx context.Context, user *wsv1alpha1.User, opts ...client.UpdateOption) (*wsv1alpha1.User, 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)
}

type GVKSetter

type GVKSetter interface {
	SetGroupVersionKind(gvk schema.GroupVersionKind)
}

Jump to

Keyboard shortcuts

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