Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrFileWrongExtension is returned when a file has an unexpected extension for a batch hook ErrFileWrongExtension = errors.New("file has wrong extension") // ErrFileNotBatchHook is returned when a file doesn't respond correctly to "hook list" ErrFileNotBatchHook = errors.New("file is not batch hook") // ErrFileNotExecutable is returned when a hook file lacks executable permissions ErrFileNotExecutable = errors.New("no executable permissions, chmod +x is required to run this hook") )
var ( // ErrPackageNotFound is returned when the requested package directory doesn't exist ErrPackageNotFound = errors.New("package not found") )
Functions ¶
This section is empty.
Types ¶
type ApplicationInstance ¶
type ApplicationInstance struct {
Name string // Unique name of the application instance
Namespace string // Kubernetes namespace where the application is deployed
Package string // Package name (directory name under appsDir)
Version string // Package version (directory name under package)
}
ApplicationInstance represents a deployed application instance. It contains the metadata needed to locate and load the corresponding package.
type ApplicationLoader ¶
type ApplicationLoader struct {
// contains filtered or unexported fields
}
ApplicationLoader loads application packages from the filesystem. It validates package structure, loads definitions, values, and hooks.
func NewApplicationLoader ¶
func NewApplicationLoader(appsDir string, logger *log.Logger) *ApplicationLoader
NewApplicationLoader creates a new ApplicationLoader for the specified directory. The appsDir should contain package directories organized as: <package>/<version>/
func (*ApplicationLoader) Load ¶
func (l *ApplicationLoader) Load(ctx context.Context, reg registry.Registry, name string) (*apps.Application, error)
Load loads an application package from the filesystem based on the instance specification. It performs the following steps:
- Validates package and version directories exist
- Loads package definition (package.yaml) - currently not used
- Loads values (static values.yaml and OpenAPI schemas)
- Discovers and loads hooks (shell and batch)
- Creates and returns an Application instance
Returns ErrPackageNotFound if package directory doesn't exist. Returns ErrVersionNotFound if version directory doesn't exist.