Documentation
¶
Index ¶
- func BuildBaseHelmValues(ctx context.Context, kubeConfig *rest.Config, ...) (values map[string]interface{}, err error)
- func GetAppConfigFromCRD(app, owner string, client *clientset.ClientSet, req *restful.Request) (*appcfg.ApplicationConfig, error)
- func ParseAppPermission(data []appcfg.AppPermission) []appcfg.AppPermission
- func ToAppTCPUDPPorts(ports []v1alpha1.ServicePort) string
- func ToEntrances(s string) (entrances []v1alpha1.Entrance, err error)
- func ToEntrancesLabel(entrances []v1alpha1.Entrance) string
- func ToTailScale(tailScale v1alpha1.TailScale) string
- type HelmOps
- func (h *HelmOps) ActionConfig() *action.Configuration
- func (h *HelmOps) AddApplicationLabelsToDeployment() error
- func (h *HelmOps) AddEnvironmentVariables(values map[string]interface{}, loadValues bool) error
- func (h *HelmOps) AddLabelToNamespaceForDependClusterApp() error
- func (h *HelmOps) App() *appcfg.ApplicationConfig
- func (h *HelmOps) ApplyEnv() error
- func (h *HelmOps) ClearCache(client kubernetes.Interface, appCacheDirs []string) error
- func (h *HelmOps) ClearData(client kubernetes.Interface, appDataDirs []string) error
- func (h *HelmOps) ClearMiddlewareRequests(middlewareNamespace string)
- func (h *HelmOps) Client() *clientset.ClientSet
- func (h *HelmOps) Context() context.Context
- func (h *HelmOps) DeleteNamespace(client kubernetes.Interface, namespace string) error
- func (h *HelmOps) Install() error
- func (h *HelmOps) IsCloneApp() bool
- func (h *HelmOps) KubeConfig() *rest.Config
- func (h *HelmOps) Options() *Opt
- func (h *HelmOps) RegisterOrUnregisterAppProvider(operation ProviderOperation) error
- func (h *HelmOps) RollBack() error
- func (h *HelmOps) SetValues() (values map[string]interface{}, err error)
- func (h *HelmOps) Settings() *cli.EnvSettings
- func (h *HelmOps) TaprApply(values map[string]interface{}, namespace string) error
- func (h *HelmOps) Token() string
- func (h *HelmOps) Uninstall() error
- func (h *HelmOps) UninstallAll() error
- func (h *HelmOps) Uninstall_(client kubernetes.Interface, actionConfig *action.Configuration, ...) error
- func (h *HelmOps) UpdatePolicy() (err error)
- func (h *HelmOps) Upgrade() error
- func (h *HelmOps) WaitForLaunch() (bool, error)
- func (h *HelmOps) WaitForStartUp() (bool, error)
- type HelmOpsInterface
- type ModelConfig
- type Operate
- type OperateHistory
- type Opt
- type ProviderOperation
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildBaseHelmValues ¶
func BuildBaseHelmValues(ctx context.Context, kubeConfig *rest.Config, appConfig *appcfg.ApplicationConfig, ownerName string, dryRun bool) (values map[string]interface{}, err error)
BuildBaseHelmValues builds the Helm values map used for both image-download (dry-run) and real install/upgrade, keeping template rendering consistent.
When dryRun is true the function fills placeholder values for keys that are expensive to obtain or have side effects (OIDC, permissions, userspace paths, cluster-scoped deps, middleware, etc.) so that a Helm template dry-run still produces a complete manifest. When dryRun is false those keys are left unset and the caller (SetValues) is expected to fill them with real data.
func GetAppConfigFromCRD ¶
func GetAppConfigFromCRD(app, owner string, client *clientset.ClientSet, req *restful.Request) (*appcfg.ApplicationConfig, error)
GetAppConfigFromCRD et app uninstallation config from crd
func ParseAppPermission ¶
func ParseAppPermission(data []appcfg.AppPermission) []appcfg.AppPermission
func ToAppTCPUDPPorts ¶
func ToAppTCPUDPPorts(ports []v1alpha1.ServicePort) string
func ToEntrancesLabel ¶
func ToTailScale ¶
Types ¶
type HelmOps ¶
type HelmOps struct {
// contains filtered or unexported fields
}
HelmOps implements HelmOpsInterface.
func (*HelmOps) ActionConfig ¶
func (h *HelmOps) ActionConfig() *action.Configuration
func (*HelmOps) AddApplicationLabelsToDeployment ¶
AddApplicationLabelsToDeployment add application label to deployment or statefulset
func (*HelmOps) AddEnvironmentVariables ¶
AddEnvironmentVariables populates olaresEnv values and marks the AppEnv as applied. When loadValues is true, it reads the env vars from the cluster into values first; when false it skips the read (useful when BuildBaseHelmValues has already populated them) and only performs the NeedApply side-effect.
func (*HelmOps) AddLabelToNamespaceForDependClusterApp ¶
func (*HelmOps) App ¶
func (h *HelmOps) App() *appcfg.ApplicationConfig
func (*HelmOps) ClearCache ¶
func (h *HelmOps) ClearCache(client kubernetes.Interface, appCacheDirs []string) error
func (*HelmOps) ClearData ¶
func (h *HelmOps) ClearData(client kubernetes.Interface, appDataDirs []string) error
func (*HelmOps) ClearMiddlewareRequests ¶
func (*HelmOps) DeleteNamespace ¶
func (h *HelmOps) DeleteNamespace(client kubernetes.Interface, namespace string) error
func (*HelmOps) IsCloneApp ¶
func (*HelmOps) KubeConfig ¶
func (*HelmOps) RegisterOrUnregisterAppProvider ¶
func (h *HelmOps) RegisterOrUnregisterAppProvider(operation ProviderOperation) error
func (*HelmOps) Settings ¶
func (h *HelmOps) Settings() *cli.EnvSettings
func (*HelmOps) UninstallAll ¶
UninstallAll do a uninstall operation for release.
func (*HelmOps) Uninstall_ ¶
func (h *HelmOps) Uninstall_(client kubernetes.Interface, actionConfig *action.Configuration, namespace, releaseName string) error
func (*HelmOps) UpdatePolicy ¶
func (*HelmOps) WaitForLaunch ¶
func (*HelmOps) WaitForStartUp ¶
type HelmOpsInterface ¶
type HelmOpsInterface interface {
// Uninstall is the action for uninstall a release.
Uninstall() error
// Install is the action for install a release.
Install() error
// Upgrade is the action for upgrade a release.
Upgrade() error
// ApplyEnv upgrades only environment variables, reusing existing values.
ApplyEnv() error
// RollBack is the action for rollback a release.
RollBack() error
WaitForLaunch() (bool, error)
UninstallAll() error
}
HelmOpsInterface is an interface that defines operations related to helm chart.
func NewHelmOps ¶
func NewHelmOps(ctx context.Context, kubeConfig *rest.Config, app *appcfg.ApplicationConfig, token string, options Opt) (HelmOpsInterface, error)
NewHelmOps constructs a new helmOps.
type ModelConfig ¶
type ModelConfig struct {
SourceURL string `json:"source_url"`
ID string `json:"id"`
Object string `json:"object"`
Name string `json:"name"`
Version string `json:"version"`
Description string `json:"description"`
Format string `json:"format"`
Settings struct {
CtxLen int `json:"ctx_len"`
PromptTemplate string `json:"prompt_template"`
} `json:"settings"`
Parameters struct {
Temperature float64 `json:"temperature"`
TopP float64 `json:"top_p"`
Stream bool `json:"stream"`
MaxTokens int `json:"max_tokens"`
Stop []interface{} `json:"stop"`
FrequencyPenalty int `json:"frequency_penalty"`
PresencePenalty int `json:"presence_penalty"`
} `json:"parameters"`
Metadata struct {
Author string `json:"author"`
Tags []string `json:"tags"`
Size int64 `json:"size"`
} `json:"metadata"`
Engine string `json:"engine"`
}
ModelConfig defines config for llm model.
type Operate ¶
type Operate struct {
AppName string `json:"appName"`
AppNamespace string `json:"appNamespace,omitempty"`
AppOwner string `json:"appOwner,omitempty"`
State v1alpha1.ApplicationManagerState `json:"state"`
OpType v1alpha1.OpType `json:"opType"`
OpID string `json:"opID"`
Message string `json:"message"`
ResourceType string `json:"resourceType"`
CreationTimestamp metav1.Time `json:"creationTimestamp"`
Source string `json:"source"`
Progress string `json:"progress,omitempty"`
}
Operate represents the certain operation for application/recommend/model/agent.
type OperateHistory ¶
type OperateHistory struct {
AppName string `json:"appName"`
AppNamespace string `json:"appNamespace"`
AppOwner string `json:"appOwner"`
ResourceType string `json:"resourceType"`
v1alpha1.OpRecord `json:",inline"`
}
OperateHistory represents the certain operation history for application/recommend/model/agent.
type ProviderOperation ¶
type ProviderOperation string
const ( Register ProviderOperation = "register" Unregister ProviderOperation = "unregister" )
type Status ¶
type Status struct {
Name string `json:"name"`
AppID string `json:"appID"`
Namespace string `json:"namespace"`
CreationTimestamp metav1.Time `json:"creationTimestamp"`
Source string `json:"source"`
AppStatus v1alpha1.ApplicationStatus `json:"status"`
}
Status represents the status of an application.