Documentation
¶
Index ¶
- func ConvertToKubernetesIdentifier(name string) string
- func ConvertToPythonIdentifier(name string) string
- func Filter[E any](s iter.Seq[E], f func(E) bool) iter.Seq[E]
- func GetConfigMapValue(ctx context.Context, c client.Client, ref client.ObjectKey, key string) (string, error)
- func GetGlobalUserID() string
- func GetObjectRef(obj client.Object) string
- func GetResourceNamespace() string
- func GetSecretValue(ctx context.Context, c client.Client, ref client.ObjectKey, key string) (string, error)
- func Map[E any, F any](s iter.Seq[E], f func(E) F) iter.Seq[F]
- func ParseRefString(ref string, parentNamespace string) (types.NamespacedName, error)
- func ResourceRefString(namespace, name string) string
- type EmptyReferenceError
- type KubeClientWrapper
- type ObjectWithModelConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToKubernetesIdentifier ¶
ConvertToKubernetesIdentifier converts Python identifiers back to Kubernetes format by replacing "__NS__" with slashes and underscores with hyphens.
func ConvertToPythonIdentifier ¶
ConvertToPythonIdentifier converts Kubernetes identifiers to Python-compatible format by replacing hyphens with underscores and slashes with "__NS__".
func GetConfigMapValue ¶
func GetConfigMapValue(ctx context.Context, c client.Client, ref client.ObjectKey, key string) (string, error)
GetConfigMapValue fetches a value from a ConfigMap
func GetGlobalUserID ¶
func GetGlobalUserID() string
func GetObjectRef ¶
GetObjectRef formats a Kubernetes object reference as "namespace/name" string.
func GetResourceNamespace ¶
func GetResourceNamespace() string
GetResourceNamespace returns the namespace for resources, using the KAGENT_NAMESPACE environment variable or defaulting to "kagent".
func GetSecretValue ¶
func GetSecretValue(ctx context.Context, c client.Client, ref client.ObjectKey, key string) (string, error)
GetSecretValue fetches a value from a Secret
func ParseRefString ¶
func ParseRefString(ref string, parentNamespace string) (types.NamespacedName, error)
ParseRefString parses a string reference (either "namespace/name" or just "name") into a NamespacedName object, using parentNamespace when namespace is not specified.
func ResourceRefString ¶
ResourceRefString formats namespace and name as a string reference in "namespace/name" format.
Types ¶
type EmptyReferenceError ¶
type EmptyReferenceError struct{}
func (*EmptyReferenceError) Error ¶
func (e *EmptyReferenceError) Error() string
type KubeClientWrapper ¶
func NewKubeClientWrapper ¶
func NewKubeClientWrapper(kube client.Client) KubeClientWrapper
type ObjectWithModelConfig ¶
ObjectWithModelConfig represents a Kubernetes resource that can be associated with a ModelConfig. It extends client.Object to provide access to standard Kubernetes object metadata while adding the ability to specify which ModelConfig should be used for the resource. Implementers must provide a GetModelConfigName() method that returns either: - An empty string: indicating the default ModelConfig should be used - A name: indicating a ModelConfig in the same namespace as the resource - A namespace/name reference: indicating a specific ModelConfig in a specific namespace