k8sclient

package
v0.2.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TODO: this needs to be dynamic
	DefaultHomeCloudNamespace = "home-cloud-system"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Apps

type Apps interface {
	Default

	// InstallApp will install the given app
	InstallApp(ctx context.Context, spec opv1.AppSpec) error
	// DeleteApp will delete the given app
	DeleteApp(ctx context.Context, spec opv1.AppSpec) error
	// UpdateApp will update the given app
	//
	// NOTE: An empty value on the spec will be applied as empty and will NOT
	// default to the existing value.
	UpdateApp(ctx context.Context, spec opv1.AppSpec) error
	// Installed returns whether or not the app with the given name is currently installed
	Installed(ctx context.Context, name string) (installed bool, err error)
	// Healthcheck will retrieve the health of all installed apps
	Healthcheck(ctx context.Context) ([]*webv1.AppHealth, error)
	// InstalledApps will retrieve all installed apps
	InstalledApps(ctx context.Context) ([]opv1.App, error)
	// AppStorage will retrieve storage volumes for the given app list
	AppStorage(ctx context.Context, apps []opv1.App) ([]*webv1.AppStorage, error)
}

Apps operates on Apps exclusively

type Client

type Client interface {
	Apps
	System
}

func NewClient

func NewClient(logger chassis.Logger) Client

type Default

type Default interface {
	Create(ctx context.Context, obj crclient.Object) error
	Get(ctx context.Context, key crclient.ObjectKey, obj crclient.Object) error
	Update(ctx context.Context, obj crclient.Object) error
	Delete(ctx context.Context, obj crclient.Object) error
	// Settings returns the installation settings
	Settings(ctx context.Context) (*opv1.SettingsSpec, error)
}

Default passes through the CRUD operations of the client

type System

type System interface {
	Default

	// GetServerVersion will retrieve the current k8s server version
	GetServerVersion(ctx context.Context) (version string, err error)
	// GetLogs will retrieve the logs for all pods across the entire cluster
	GetLogs(ctx context.Context, logger chassis.Logger, sinceSeconds int64) ([]*dv1.Log, error)
}

System operates on system components (logs, versions)

Jump to

Keyboard shortcuts

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