Help us shape the future of Go! Take the 2026 Go Developer Survey

kubernetes

package
v0.2.39 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBoundary = errors.New("Kubernetes workspace violates execution boundary")
View Source
var ErrEgressBootstrap = errors.New("registry egress bootstrap unavailable")
View Source
var ErrOutputLimit = errors.New("Kubernetes exec output limit exceeded")
View Source
var ErrTransport = errors.New("Kubernetes API transport failed")
View Source
var ErrUnavailable = errors.New("Kubernetes sandbox unavailable")

Functions

func ValidateConfig

func ValidateConfig(cfg Config) error

Types

type APIConfig

type APIConfig struct {
	Namespace string
	TokenFile string
	CAFile    string
}

type BootstrapLease

type BootstrapLease interface {
	Refs() BootstrapRefs
	EndEgress(context.Context) error
	Close(context.Context) error
}

type BootstrapRefs

type BootstrapRefs struct {
	Dependencies string
	Egress       string
}

type Bootstrapper

type Bootstrapper interface {
	Prepare(context.Context, sandbox.WorkspaceRequest, string) (BootstrapLease, error)
}

func NewRegistryBootstrapper

func NewRegistryBootstrapper(broker *egress.Broker, advertisedAddr string) (Bootstrapper, error)

type Cache added in v0.2.33

type Cache struct {
	StorageClass string
	AccessMode   string
	Bytes        int64
}

type Claim added in v0.2.33

type Claim struct {
	Name         string
	StorageClass string
	AccessMode   string
	Bytes        int64
}

type Config

type Config struct {
	Namespace        string
	RunnerID         string
	RuntimeClassName string
	ImagePullSecrets []string
	Images           map[string]string
	Cache            Cache
	MemoryBytes      int64
	DiskBytes        int64
	CPUs             int64
	MaxProcesses     int64
	Fetch            func(context.Context, sandbox.WorkspaceRequest) (sandbox.Snapshot, error)
	Client           PodClient
	Bootstrapper     Bootstrapper
	ReadyTimeout     time.Duration
	PollInterval     time.Duration
}

type HTTPPodClient

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

func NewHTTPPodClient

func NewHTTPPodClient(cfg APIConfig) (*HTTPPodClient, error)

func (*HTTPPodClient) Create

func (c *HTTPPodClient) Create(ctx context.Context, spec PodSpec) (Pod, error)

func (*HTTPPodClient) Delete

func (c *HTTPPodClient) Delete(ctx context.Context, ref PodRef) error

func (*HTTPPodClient) EnsureClaim added in v0.2.33

func (c *HTTPPodClient) EnsureClaim(ctx context.Context, claim Claim) error

func (*HTTPPodClient) Exec

func (c *HTTPPodClient) Exec(ctx context.Context, ref PodRef, command []string, stdin io.Reader, stdout, stderr io.Writer) (int, error)

func (*HTTPPodClient) Get

func (c *HTTPPodClient) Get(ctx context.Context, ref PodRef) (Pod, error)

func (*HTTPPodClient) List

func (c *HTTPPodClient) List(ctx context.Context, labels map[string]string) ([]Pod, error)

type Pod

type Pod struct {
	Ref                   PodRef
	Phase                 string
	Reason                string
	Message               string
	CreatedAt             time.Time
	ActiveDeadlineSeconds int64
	Labels                map[string]string
	Unschedulable         bool
}

type PodClient

type PodClient interface {
	Create(context.Context, PodSpec) (Pod, error)
	Get(context.Context, PodRef) (Pod, error)
	List(context.Context, map[string]string) ([]Pod, error)
	Exec(context.Context, PodRef, []string, io.Reader, io.Writer, io.Writer) (int, error)
	Delete(context.Context, PodRef) error
	EnsureClaim(context.Context, Claim) error
}

type PodRef

type PodRef struct {
	Namespace string
	Name      string
	UID       string
}

type PodSpec

type PodSpec struct {
	Ref                          PodRef
	Labels                       map[string]string
	Image                        string
	RuntimeClassName             string
	ImagePullSecrets             []string
	ContainerName                string
	WorkingDirectory             string
	Environment                  []string
	RunAsUser                    int64
	RunAsNonRoot                 bool
	RunAsGroup                   int64
	FSGroup                      int64
	AllowPrivilegeEscalation     bool
	ReadOnlyRootFilesystem       bool
	DropCapabilities             []string
	SeccompProfile               string
	AutomountServiceAccountToken bool
	HostNetwork                  bool
	HostPID                      bool
	HostIPC                      bool
	HostPaths                    []string
	CacheClaim                   string
	WorkspaceEmptyDirBytes       int64
	TempEmptyDirBytes            int64
	NetworkProfile               string
	Resources                    Resources
	ActiveDeadlineSeconds        int64
	RestartPolicy                string
	Bootstrap                    BootstrapRefs
}

type Resources

type Resources struct {
	MemoryBytes int64
	CPUs        int64
	DiskBytes   int64
	PidsLimit   int64
}

type Runtime

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

func NewRuntime

func NewRuntime(cfg Config) (*Runtime, error)

func (*Runtime) ApplyPatch

func (r *Runtime) ApplyPatch(ctx context.Context, workspace sandbox.Workspace, patches []sandbox.Patch) error

func (*Runtime) Close

func (r *Runtime) Close() error

func (*Runtime) CollectArtifact

func (r *Runtime) CollectArtifact(ctx context.Context, workspace sandbox.Workspace, name string) (sandbox.Artifact, error)

func (*Runtime) Destroy

func (r *Runtime) Destroy(ctx context.Context, workspace sandbox.Workspace) error

func (*Runtime) ExecuteBoundedCommand

func (r *Runtime) ExecuteBoundedCommand(ctx context.Context, workspace sandbox.Workspace, command sandbox.Command) (sandbox.CommandResult, error)

func (*Runtime) PreparePinnedWorkspace

func (r *Runtime) PreparePinnedWorkspace(ctx context.Context, in sandbox.WorkspaceRequest) (sandbox.Workspace, error)

Jump to

Keyboard shortcuts

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