envcommon

package
v0.0.7 Latest Latest
Warning

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

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

Documentation

Overview

Package envcommon hosts the helpers shared between the env shell service (pkg/apiserver/service) and the per-resource sub-services (envmember, envautoscaler). It exists so the sub-services can be composed back into SandboxEnvService without an import cycle on the outer service package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvNameFromOwnerRefs

func EnvNameFromOwnerRefs(refs []metav1.OwnerReference) string

EnvNameFromOwnerRefs returns the Env name from a Pool's owner references, or "" when the Pool is unowned (e.g. mid-adoption).

func LocalClusterMembers

func LocalClusterMembers(spec *agentsv1alpha1.SandboxEnvSpec, localClusterID string) []agentsv1alpha1.EnvClusterMember

LocalClusterMembers returns a copy of the member list for the cluster segment matching localClusterID. An empty result includes both "segment absent" and "segment present with empty members".

func PoolToGen

PoolToGen converts a CRD SandboxPool to the full gen wire shape. It is the PoolToSummary projection plus SpecYaml (the full EmbeddedSandboxTemplate serialised to YAML), which the Pool detail view consumes. Use this on the Get path; the List path uses PoolToSummary to keep the payload lean.

func PoolToSummary

PoolToSummary converts a CRD SandboxPool to the lightweight list wire shape (gen.SandboxPoolSummary). It projects everything the dashboard pool table reads — replicas, default timeouts, template reference, status counts, computed CPU/Memory, scaling group, owning Env — but deliberately OMITS the heavy SpecYaml (full pod-template YAML), which no list consumer reads. Use PoolToGen for the Get path when the full body (incl. SpecYaml diff source) is needed.

Pool is no longer a user-facing object — the only callers are the env-scoped Pool CRUD endpoints in pkg/apiserver/service/envmember, which project pools they read off the K8s API server before returning them to the dashboard. There is no longer a top-level /sandboxpools service.

func SetLocalClusterMembers

func SetLocalClusterMembers(spec *agentsv1alpha1.SandboxEnvSpec, localClusterID string, members []agentsv1alpha1.EnvClusterMember)

SetLocalClusterMembers replaces the Members slice on the cluster segment matching localClusterID, creating the segment when absent. Passing an empty members slice clears the local segment's members (the Reconciler then falls back to a single namesake Pool).

Types

This section is empty.

Jump to

Keyboard shortcuts

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