Documentation
¶
Index ¶
- Constants
- func ApplyInNamespace(ctx context.Context, cli client.Client, ns string, objects ...client.Object) error
- func CheckDependecies(requirements string, installs map[string]PluginVersion) error
- func CheckDependecy(requirements string, exist PluginVersion) error
- func CheckHealthy(ctx context.Context, cli client.Client, plugin *PluginVersion)
- func IsPluginChart(cv *repo.ChartVersion) bool
- func ParseInstallerObjects(path string, values GlobalValues) ([]client.Object, error)
- func ParseRequirements(str string) map[string]*semver.Constraints
- func SemVersionBiggerThan(a, b string) bool
- type Bootstrap
- type ErrorList
- type GlobalValues
- type Plugin
- type PluginManager
- func (m *PluginManager) CheckUpdate(ctx context.Context) (map[string]Plugin, error)
- func (p *PluginManager) DeleteRepo(ctx context.Context, name string) error
- func (m *PluginManager) Get(ctx context.Context, name string) (*Plugin, error)
- func (m *PluginManager) GetGlobalValues(ctx context.Context) (*GlobalValues, error)
- func (m *PluginManager) GetInstalled(ctx context.Context, name string) (*PluginVersion, error)
- func (m *PluginManager) GetPluginVersion(ctx context.Context, name, version string, withSchema bool) (*PluginVersion, error)
- func (m *PluginManager) GetRemote(ctx context.Context, name string) ([]PluginVersion, error)
- func (p *PluginManager) GetRepo(ctx context.Context, name string) (*Repository, error)
- func (m *PluginManager) Install(ctx context.Context, name string, version string, values map[string]any) error
- func (m *PluginManager) ListInstalled(ctx context.Context, checkHealthy bool) (map[string]PluginVersion, error)
- func (m *PluginManager) ListPlugins(ctx context.Context) (map[string]Plugin, error)
- func (m *PluginManager) ListRemote(ctx context.Context) (map[string][]PluginVersion, error)
- func (p *PluginManager) ListRepos(ctx context.Context) (map[string]Repository, error)
- func (p *PluginManager) SetRepo(ctx context.Context, repo *Repository, withRefresh bool) error
- func (m *PluginManager) UnInstall(ctx context.Context, name string) error
- func (m *PluginManager) UpdateLocalRepoCache(ctx context.Context) error
- func (p *PluginManager) UpdateReposCache(ctx context.Context) error
- type PluginVersion
- type Repository
- type Requirement
Constants ¶
View Source
const ( KubegemsChartsRepoURL = "https://charts.kubegems.io/kubegems" KubeGemPluginsPath = "plugins" )
View Source
const DefaultPluginsDir = "plugins"
View Source
const PluginRepositoriesNamePrefix = "plugin-repository-"
Variables ¶
This section is empty.
Functions ¶
func ApplyInNamespace ¶
func CheckDependecies ¶
func CheckDependecies(requirements string, installs map[string]PluginVersion) error
func CheckDependecy ¶
func CheckDependecy(requirements string, exist PluginVersion) error
func CheckHealthy ¶
func CheckHealthy(ctx context.Context, cli client.Client, plugin *PluginVersion)
func IsPluginChart ¶
func IsPluginChart(cv *repo.ChartVersion) bool
func ParseInstallerObjects ¶
func ParseInstallerObjects(path string, values GlobalValues) ([]client.Object, error)
func ParseRequirements ¶
ParseRequirements
func SemVersionBiggerThan ¶
Types ¶
type Bootstrap ¶
type Bootstrap struct { Config *rest.Config // target cluster config Namespace string // installer namespace }
type GlobalValues ¶
type Plugin ¶
type Plugin struct { Name string `json:"name"` Namespace string `json:"namespace"` MainCategory string `json:"mainCategory"` Category string `json:"category"` Upgradeable *PluginVersion `json:"upgradeable"` Required bool `json:"required"` Installed *PluginVersion `json:"installed"` Available []PluginVersion `json:"available"` Description string `json:"description"` }
type PluginManager ¶
func DefaultPluginManager ¶
func DefaultPluginManager(cachedir string) (*PluginManager, error)
func (*PluginManager) CheckUpdate ¶
func (*PluginManager) DeleteRepo ¶
func (p *PluginManager) DeleteRepo(ctx context.Context, name string) error
func (*PluginManager) GetGlobalValues ¶
func (m *PluginManager) GetGlobalValues(ctx context.Context) (*GlobalValues, error)
func (*PluginManager) GetInstalled ¶
func (m *PluginManager) GetInstalled(ctx context.Context, name string) (*PluginVersion, error)
func (*PluginManager) GetPluginVersion ¶
func (m *PluginManager) GetPluginVersion(ctx context.Context, name, version string, withSchema bool) (*PluginVersion, error)
func (*PluginManager) GetRemote ¶
func (m *PluginManager) GetRemote(ctx context.Context, name string) ([]PluginVersion, error)
func (*PluginManager) GetRepo ¶
func (p *PluginManager) GetRepo(ctx context.Context, name string) (*Repository, error)
func (*PluginManager) ListInstalled ¶
func (m *PluginManager) ListInstalled(ctx context.Context, checkHealthy bool) (map[string]PluginVersion, error)
func (*PluginManager) ListPlugins ¶
func (*PluginManager) ListRemote ¶
func (m *PluginManager) ListRemote(ctx context.Context) (map[string][]PluginVersion, error)
func (*PluginManager) ListRepos ¶
func (p *PluginManager) ListRepos(ctx context.Context) (map[string]Repository, error)
func (*PluginManager) SetRepo ¶
func (p *PluginManager) SetRepo(ctx context.Context, repo *Repository, withRefresh bool) error
func (*PluginManager) UnInstall ¶
func (m *PluginManager) UnInstall(ctx context.Context, name string) error
func (*PluginManager) UpdateLocalRepoCache ¶
func (m *PluginManager) UpdateLocalRepoCache(ctx context.Context) error
func (*PluginManager) UpdateReposCache ¶
func (p *PluginManager) UpdateReposCache(ctx context.Context) error
type PluginVersion ¶
type PluginVersion struct { Name string `json:"name,omitempty"` Namespace string `json:"namespace,omitempty"` Enabled bool `json:"enabled,omitempty"` InstallNamespace string `json:"installNamespace,omitempty"` Kind pluginsv1beta1.BundleKind `json:"kind,omitempty"` Description string `json:"description,omitempty"` HelathCheck string `json:"helathCheck,omitempty"` MainCategory string `json:"mainCategory,omitempty"` Category string `json:"category,omitempty"` Repository string `json:"repository,omitempty"` Version string `json:"version,omitempty"` Healthy bool `json:"healthy,omitempty"` Required bool `json:"required,omitempty"` Requirements string `json:"requirements,omitempty"` // dependecies requirements Message string `json:"message,omitempty"` Values pluginsv1beta1.Values `json:"values,omitempty"` Schema string `json:"schema"` ValuesFrom []pluginsv1beta1.ValuesFrom `json:"valuesFrom,omitempty"` Priority int `json:"priority,omitempty"` }
func FindUpgradeable ¶
func FindUpgradeable(availables []PluginVersion, installed PluginVersion, allinstall map[string]PluginVersion) *PluginVersion
func PluginVersionFrom ¶
func PluginVersionFrom(plugin pluginsv1beta1.Plugin) PluginVersion
func PluginVersionFromRepoChartVersion ¶
func PluginVersionFromRepoChartVersion(repo string, cv *repo.ChartVersion) PluginVersion
func (PluginVersion) ToPlugin ¶
func (pv PluginVersion) ToPlugin() *pluginsv1beta1.Plugin
type Repository ¶
type Repository struct { Name string `json:"name,omitempty"` Priority int `json:"priority,omitempty"` Address string `json:"address,omitempty"` Plugins map[string][]PluginVersion `json:"plugins,omitempty"` LastSync time.Time `json:"lastSync,omitempty"` }
func (*Repository) RefreshRepoIndex ¶
func (repository *Repository) RefreshRepoIndex(ctx context.Context) error
type Requirement ¶
Click to show internal directories.
Click to hide internal directories.