appinstaller

package
v0.0.0-...-5862f75 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: AGPL-3.0 Imports: 43 Imported by: 0

Documentation

Index

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 ToEntrances

func ToEntrances(s string) (entrances []v1alpha1.Entrance, err error)

func ToEntrancesLabel

func ToEntrancesLabel(entrances []v1alpha1.Entrance) string

func ToTailScale

func ToTailScale(tailScale v1alpha1.TailScale) string

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

func (h *HelmOps) AddApplicationLabelsToDeployment() error

AddApplicationLabelsToDeployment add application label to deployment or statefulset

func (*HelmOps) AddEnvironmentVariables

func (h *HelmOps) AddEnvironmentVariables(values map[string]interface{}, loadValues bool) error

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 (h *HelmOps) AddLabelToNamespaceForDependClusterApp() error

func (*HelmOps) App

func (h *HelmOps) App() *appcfg.ApplicationConfig

func (*HelmOps) ApplyEnv

func (h *HelmOps) ApplyEnv() error

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 (h *HelmOps) ClearMiddlewareRequests(middlewareNamespace string)

func (*HelmOps) Client

func (h *HelmOps) Client() *clientset.ClientSet

func (*HelmOps) Context

func (h *HelmOps) Context() context.Context

func (*HelmOps) DeleteNamespace

func (h *HelmOps) DeleteNamespace(client kubernetes.Interface, namespace string) error

func (*HelmOps) Install

func (h *HelmOps) Install() error

func (*HelmOps) IsCloneApp

func (h *HelmOps) IsCloneApp() bool

func (*HelmOps) KubeConfig

func (h *HelmOps) KubeConfig() *rest.Config

func (*HelmOps) Options

func (h *HelmOps) Options() *Opt

func (*HelmOps) RegisterOrUnregisterAppProvider

func (h *HelmOps) RegisterOrUnregisterAppProvider(operation ProviderOperation) error

func (*HelmOps) RollBack

func (h *HelmOps) RollBack() error

RollBack do a rollback for release if it can be rollback.

func (*HelmOps) SetValues

func (h *HelmOps) SetValues() (values map[string]interface{}, err error)

func (*HelmOps) Settings

func (h *HelmOps) Settings() *cli.EnvSettings

func (*HelmOps) TaprApply

func (h *HelmOps) TaprApply(values map[string]interface{}, namespace string) error

func (*HelmOps) Token

func (h *HelmOps) Token() string

func (*HelmOps) Uninstall

func (h *HelmOps) Uninstall() error

func (*HelmOps) UninstallAll

func (h *HelmOps) UninstallAll() error

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 (h *HelmOps) UpdatePolicy() (err error)

func (*HelmOps) Upgrade

func (h *HelmOps) Upgrade() error

Upgrade do a upgrade operation for release.

func (*HelmOps) WaitForLaunch

func (h *HelmOps) WaitForLaunch() (bool, error)

func (*HelmOps) WaitForStartUp

func (h *HelmOps) WaitForStartUp() (bool, error)

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 Opt

type Opt struct {
	Source       string
	MarketSource string
}

Opt options for helm ops.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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