Documentation
¶
Index ¶
- func EnsurePackages(app *inapi.AppInstance) (map[string]string, error)
- func NewInternalServer() inapi.HostInternalServiceServer
- func PackageDownload(pkgRef *inapi.AppSpecPackage) (string, error)
- func Run()
- func TryRun() error
- type PackagePaths
- type QuotaConfig
- func (it *QuotaConfig) Fetch(name string) *QuotaProject
- func (it *QuotaConfig) FetchById(id int) *QuotaProject
- func (it *QuotaConfig) FetchOrCreate(mnt, name string) *QuotaProject
- func (it *QuotaConfig) Has(id uint32) bool
- func (it *QuotaConfig) Remove(name string)
- func (it *QuotaConfig) Sync() error
- func (it *QuotaConfig) SyncVendor() error
- type QuotaProject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsurePackages ¶
func EnsurePackages(app *inapi.AppInstance) (map[string]string, error)
EnsurePackages downloads and prepares all packages for an app. It returns a map of package name -> install path. Duplicate packages (same name and version) are skipped.
func NewInternalServer ¶
func NewInternalServer() inapi.HostInternalServiceServer
func PackageDownload ¶
func PackageDownload(pkgRef *inapi.AppSpecPackage) (string, error)
PackageDownload downloads a package from zonelet and extracts it. It returns the install path of the extracted package. The operation is idempotent - if the package is already downloaded and extracted, it returns the existing path.
Types ¶
type PackagePaths ¶
type PackagePaths struct {
// contains filtered or unexported fields
}
PackagePaths provides path utilities for package storage.
func NewPackagePaths ¶
func NewPackagePaths(prefix string) *PackagePaths
NewPackagePaths creates a PackagePaths instance.
func (*PackagePaths) IpkDir ¶
func (p *PackagePaths) IpkDir() string
IpkDir returns the base directory for ipk files.
func (*PackagePaths) IpkFile ¶
func (p *PackagePaths) IpkFile(pkgName, pkgId string) string
IpkFile returns the path to the ipk archive file. Format: {prefix}/var/ipk/{name}/{name}_{version}_{os}_{arch}.ipk
func (*PackagePaths) IpkInstallDir ¶
func (p *PackagePaths) IpkInstallDir() string
IpkInstallDir returns the base directory for extracted packages.
func (*PackagePaths) IpkInstallPath ¶
func (p *PackagePaths) IpkInstallPath(pkgName, pkgId string) string
IpkInstallPath returns the path to the extracted package directory. Format: {prefix}/var/ipk_install/{name}/{name}_{version}_{os}_{arch}/
type QuotaConfig ¶
type QuotaConfig struct {
Items []*QuotaProject `json:"items,omitempty"`
Updated int64 `json:"updated"`
IdOffset int `json:"id_offset"`
MountPoints []string `json:"mount_points"`
// contains filtered or unexported fields
}
QuotaConfig manages XFS project quota entries for pod volume isolation. It persists quota state to a JSON file and synchronizes the kernel quota projects via the xfs_quota command-line tool.
func (*QuotaConfig) Fetch ¶
func (it *QuotaConfig) Fetch(name string) *QuotaProject
Fetch returns the quota project with the given name, or nil.
func (*QuotaConfig) FetchById ¶
func (it *QuotaConfig) FetchById(id int) *QuotaProject
FetchById returns the quota project with the given project ID, or nil.
func (*QuotaConfig) FetchOrCreate ¶
func (it *QuotaConfig) FetchOrCreate(mnt, name string) *QuotaProject
FetchOrCreate returns an existing project by name, or allocates a new one. The project ID is assigned from a sequentially increasing offset (starting at 100) with gap detection to reuse IDs freed by removed projects.
func (*QuotaConfig) Has ¶
func (it *QuotaConfig) Has(id uint32) bool
Has checks whether a project with the given ID exists.
func (*QuotaConfig) Remove ¶
func (it *QuotaConfig) Remove(name string)
Remove deletes the project with the given name from the in-memory list.
func (*QuotaConfig) Sync ¶
func (it *QuotaConfig) Sync() error
Sync persists the quota configuration to the JSON state file.
func (*QuotaConfig) SyncVendor ¶
func (it *QuotaConfig) SyncVendor() error
SyncVendor writes the /etc/projects file that maps project IDs to their directory paths. The file is only rewritten when content changes (detected via SHA1 checksum) to minimize unnecessary disk I/O.
It preserves any existing v1 entries that are not managed by v2, enabling coexistence during migration from v1 to v2.
type QuotaProject ¶
type QuotaProject struct {
Id int `json:"id"`
Mnt string `json:"mnt"`
Name string `json:"name"`
Soft int64 `json:"soft"`
Hard int64 `json:"hard"`
Used int64 `json:"used"`
}
QuotaProject represents a single XFS project quota entry. Each active container/pod gets a unique project ID with configured soft/hard block limits enforced by the XFS filesystem.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package docker provides a Docker container driver implementation.
|
Package docker provides a Docker container driver implementation. |