config

package
v0.2.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultSyncthingVersion       = "v1.29.7"
	DefaultSidecarImageRepository = "ghcr.io/acmore/okdev"
	DefaultSidecarImageFallback   = "edge"
	DefaultWorkspacePVCSize       = "50Gi"
)
View Source
const (
	DefaultWorkspacePath = "/workspace"
	DefaultWorkspaceName = "workspace"
)
View Source
const (
	DefaultFile = ".okdev.yaml"
	FolderFile  = ".okdev/okdev.yaml"
	LegacyFile  = "okdev.yaml"
)

Variables

View Source
var DefaultTemplate = basicTemplate

Functions

func DefaultSidecarImageForBinaryVersion added in v0.2.0

func DefaultSidecarImageForBinaryVersion(binaryVersion string) string

func ResolvePath

func ResolvePath(configPath string) (string, error)

func TemplateByName

func TemplateByName(name string) (string, error)

Types

type DevEnvSpec

type DevEnvSpec struct {
	Namespace   string           `yaml:"namespace"`
	KubeContext string           `yaml:"kubeContext"`
	Session     SessionSpec      `yaml:"session"`
	Volumes     []corev1.Volume  `yaml:"volumes"`
	Workspace   *LegacyWorkspace `yaml:"workspace,omitempty"`
	Sync        SyncSpec         `yaml:"sync"`
	Ports       []PortMapping    `yaml:"ports"`
	SSH         SSHSpec          `yaml:"ssh"`
	Lifecycle   LifecycleSpec    `yaml:"lifecycle"`
	Sidecar     SidecarSpec      `yaml:"sidecar"`
	PodTemplate PodTemplateRef   `yaml:"podTemplate"`
}

type DevEnvironment

type DevEnvironment struct {
	APIVersion string     `yaml:"apiVersion"`
	Kind       string     `yaml:"kind"`
	Metadata   Metadata   `yaml:"metadata"`
	Spec       DevEnvSpec `yaml:"spec"`
}

DevEnvironment is the top-level config structure for .okdev.yaml.

func Load

func Load(configPath string) (*DevEnvironment, string, error)

func (*DevEnvironment) EffectiveVolumes added in v0.2.4

func (d *DevEnvironment) EffectiveVolumes() []corev1.Volume

func (*DevEnvironment) SetDefaults

func (d *DevEnvironment) SetDefaults()

func (*DevEnvironment) Validate

func (d *DevEnvironment) Validate() error

func (*DevEnvironment) WorkspaceMountPath added in v0.2.4

func (d *DevEnvironment) WorkspaceMountPath() string

type LegacyWorkspace added in v0.2.4

type LegacyWorkspace struct {
	MountPath string            `yaml:"mountPath"`
	PVC       map[string]string `yaml:"pvc"`
}

LegacyWorkspace exists only to produce a clear migration error for removed config.

type LifecycleSpec added in v0.2.0

type LifecycleSpec struct {
	PostCreate string `yaml:"postCreate"`
	PreStop    string `yaml:"preStop"`
}

type Metadata

type Metadata struct {
	Name string `yaml:"name"`
}

type MetadataMap

type MetadataMap struct {
	Labels map[string]string `yaml:"labels"`
}

type PodTemplateRef

type PodTemplateRef struct {
	Metadata MetadataMap    `yaml:"metadata"`
	Spec     corev1.PodSpec `yaml:"spec"`
}

type PortMapping

type PortMapping struct {
	Name   string `yaml:"name"`
	Local  int    `yaml:"local"`
	Remote int    `yaml:"remote"`
}

type SSHSpec

type SSHSpec struct {
	User              string `yaml:"user"`
	RemotePort        int    `yaml:"remotePort"`
	PrivateKeyPath    string `yaml:"privateKeyPath"`
	AutoDetectPorts   *bool  `yaml:"autoDetectPorts"`
	PersistentSession *bool  `yaml:"persistentSession"`
	KeepAliveInterval int    `yaml:"keepAliveIntervalSeconds"`
	KeepAliveTimeout  int    `yaml:"keepAliveTimeoutSeconds"`
	KeepAliveCountMax int    `yaml:"keepAliveCountMax"`
}

func (SSHSpec) PersistentSessionEnabled added in v0.2.0

func (s SSHSpec) PersistentSessionEnabled() bool

type SessionSpec

type SessionSpec struct {
	DefaultNameTemplate string `yaml:"defaultNameTemplate"`
	TTLHours            int    `yaml:"ttlHours"`
	IdleTimeoutMinutes  int    `yaml:"idleTimeoutMinutes"`
	Shareable           bool   `yaml:"shareable"`
}

type SidecarSpec added in v0.2.0

type SidecarSpec struct {
	Image string `yaml:"image"`
}

type SyncSpec

type SyncSpec struct {
	Paths         []string      `yaml:"paths"`
	Exclude       []string      `yaml:"exclude"`
	RemoteExclude []string      `yaml:"remoteExclude"`
	Engine        string        `yaml:"engine"`
	Syncthing     SyncthingSpec `yaml:"syncthing"`
}

type SyncthingSpec

type SyncthingSpec struct {
	Version     string `yaml:"version"`
	AutoInstall *bool  `yaml:"autoInstall"`
	Image       string `yaml:"image"`
}

func (SyncthingSpec) AutoInstallEnabled

func (s SyncthingSpec) AutoInstallEnabled() bool

Jump to

Keyboard shortcuts

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