Documentation
¶
Index ¶
- Constants
- func AnnotationsWithWorkload(base map[string]string, workloadName, apiVersion, resourceKind string) map[string]string
- func ComparePodPriority(a, b kube.PodSummary) bool
- func DiscoveryLabelSelector(labels map[string]string) string
- func LabelsWithWorkload(base map[string]string, workloadName, resourceKind string) map[string]string
- func ResolveManifestPath(configPath, manifestPath string) string
- type ApplyClient
- type DeleteClient
- type GenericRuntime
- func (r *GenericRuntime) Apply(ctx context.Context, k ApplyClient, namespace string) error
- func (r *GenericRuntime) Delete(ctx context.Context, k DeleteClient, namespace string, ignoreNotFound bool) error
- func (r *GenericRuntime) Kind() string
- func (r *GenericRuntime) SelectTarget(ctx context.Context, k TargetClient, namespace string) (TargetRef, error)
- func (r *GenericRuntime) WaitReady(ctx context.Context, k WaitClient, namespace string, timeout time.Duration, ...) error
- func (r *GenericRuntime) WorkloadName() string
- func (r *GenericRuntime) WorkloadRef() (string, string, string, error)
- type PodRuntime
- func (r *PodRuntime) Apply(ctx context.Context, k ApplyClient, namespace string) error
- func (r *PodRuntime) Delete(ctx context.Context, k DeleteClient, namespace string, ignoreNotFound bool) error
- func (r *PodRuntime) Kind() string
- func (r *PodRuntime) SelectTarget(ctx context.Context, k TargetClient, namespace string) (TargetRef, error)
- func (r *PodRuntime) WaitReady(ctx context.Context, k WaitClient, namespace string, timeout time.Duration, ...) error
- func (r *PodRuntime) WorkloadName() string
- func (r *PodRuntime) WorkloadRef() (string, string, string, error)
- type RefProvider
- type Runtime
- type TargetClient
- type TargetRef
- type WaitClient
- type WorkloadManifestTemplateVars
Constants ¶
View Source
const ( TypePod = "pod" TypeJob = "job" TypePyTorchJob = "pytorchjob" TypeGeneric = "generic" AnnotationLastAppliedSpec = "okdev.io/last-applied-spec" AnnotationLastAppliedHash = "okdev.io/last-applied-spec-sha256" )
View Source
const DefaultTargetContainer = "dev"
Variables ¶
This section is empty.
Functions ¶
func AnnotationsWithWorkload ¶
func ComparePodPriority ¶
func ComparePodPriority(a, b kube.PodSummary) bool
ComparePodPriority is the canonical pod scoring function used by both runtime target selection and session view display. Pods are scored by: +8 for having a last-attach annotation, +4 for Running phase, +2 for Ready status. Ties broken by creation time (newest first), then name.
func DiscoveryLabelSelector ¶
DiscoveryLabelSelector returns a label selector using only the session-identifying labels needed for pod discovery. This avoids passing workload-specific labels that controllers might not propagate to child pods.
func LabelsWithWorkload ¶
func ResolveManifestPath ¶
Types ¶
type ApplyClient ¶
type DeleteClient ¶
type GenericRuntime ¶
type GenericRuntime struct {
SessionName string
WorkloadNameOverride string
WorkloadKind string
ManifestPath string
WorkspaceMountPath string
SidecarImage string
SidecarResources corev1.ResourceRequirements
Tmux bool
PreStop string
TargetContainer string
Volumes []corev1.Volume
Labels map[string]string
Annotations map[string]string
Inject []config.WorkloadInjectSpec
LastAppliedSpecJSON string
LastAppliedSpecHash string
// contains filtered or unexported fields
}
func (*GenericRuntime) Apply ¶
func (r *GenericRuntime) Apply(ctx context.Context, k ApplyClient, namespace string) error
func (*GenericRuntime) Delete ¶
func (r *GenericRuntime) Delete(ctx context.Context, k DeleteClient, namespace string, ignoreNotFound bool) error
func (*GenericRuntime) Kind ¶
func (r *GenericRuntime) Kind() string
func (*GenericRuntime) SelectTarget ¶
func (r *GenericRuntime) SelectTarget(ctx context.Context, k TargetClient, namespace string) (TargetRef, error)
func (*GenericRuntime) WaitReady ¶
func (r *GenericRuntime) WaitReady(ctx context.Context, k WaitClient, namespace string, timeout time.Duration, onProgress func(kube.PodReadinessProgress)) error
func (*GenericRuntime) WorkloadName ¶
func (r *GenericRuntime) WorkloadName() string
func (*GenericRuntime) WorkloadRef ¶
func (r *GenericRuntime) WorkloadRef() (string, string, string, error)
type PodRuntime ¶
type PodRuntime struct {
SessionName string
WorkloadNameOverride string
Labels map[string]string
Annotations map[string]string
PodSpec corev1.PodSpec
Volumes []corev1.Volume
WorkspaceMountPath string
SidecarImage string
SidecarResources corev1.ResourceRequirements
Tmux bool
PreStop string
TargetContainer string
LastAppliedSpecJSON string
LastAppliedSpecHash string
}
func NewPodRuntime ¶
func (*PodRuntime) Apply ¶
func (r *PodRuntime) Apply(ctx context.Context, k ApplyClient, namespace string) error
func (*PodRuntime) Delete ¶
func (r *PodRuntime) Delete(ctx context.Context, k DeleteClient, namespace string, ignoreNotFound bool) error
func (*PodRuntime) Kind ¶
func (r *PodRuntime) Kind() string
func (*PodRuntime) SelectTarget ¶
func (r *PodRuntime) SelectTarget(ctx context.Context, k TargetClient, namespace string) (TargetRef, error)
func (*PodRuntime) WaitReady ¶
func (r *PodRuntime) WaitReady(ctx context.Context, k WaitClient, namespace string, timeout time.Duration, onProgress func(kube.PodReadinessProgress)) error
func (*PodRuntime) WorkloadName ¶
func (r *PodRuntime) WorkloadName() string
func (*PodRuntime) WorkloadRef ¶
func (r *PodRuntime) WorkloadRef() (string, string, string, error)
type RefProvider ¶
type Runtime ¶
type Runtime interface {
Kind() string
WorkloadName() string
Apply(ctx context.Context, k ApplyClient, namespace string) error
Delete(ctx context.Context, k DeleteClient, namespace string, ignoreNotFound bool) error
WaitReady(ctx context.Context, k WaitClient, namespace string, timeout time.Duration, onProgress func(kube.PodReadinessProgress)) error
SelectTarget(ctx context.Context, k TargetClient, namespace string) (TargetRef, error)
}
type TargetClient ¶
type WaitClient ¶
Click to show internal directories.
Click to hide internal directories.