gemsplugin

package
v1.23.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2022 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

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 ApplyInNamespace(ctx context.Context, cli client.Client, ns string, objects ...client.Object) error

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

func ParseRequirements(str string) map[string]*semver.Constraints

ParseRequirements

func SemVersionBiggerThan

func SemVersionBiggerThan(a, b string) bool

Types

type Bootstrap

type Bootstrap struct {
	Config    *rest.Config // target cluster config
	Namespace string       // installer namespace
}

func (Bootstrap) Install

func (i Bootstrap) Install(ctx context.Context, values GlobalValues) error

func (Bootstrap) Remove

func (i Bootstrap) Remove(ctx context.Context) error

type ErrorList

type ErrorList []error

func (ErrorList) Error

func (list ErrorList) Error() string

type GlobalValues

type GlobalValues struct {
	ImageRegistry   string `json:"imageRegistry"`
	ImageRepository string `json:"imageRepository"`
	ClusterName     string `json:"clusterName"`
	StorageClass    string `json:"storageClass"`
	KubegemsVersion string `json:"kubegemsVersion"`
	Runtime         string `json:"runtime"`
}

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

type PluginManager struct {
	CacheDir string
	Client   client.Client
}

func DefaultPluginManager

func DefaultPluginManager(cachedir string) (*PluginManager, error)

func (*PluginManager) CheckUpdate

func (m *PluginManager) CheckUpdate(ctx context.Context) (map[string]Plugin, error)

func (*PluginManager) DeleteRepo

func (p *PluginManager) DeleteRepo(ctx context.Context, name string) error

func (*PluginManager) Get

func (m *PluginManager) Get(ctx context.Context, name string) (*Plugin, 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) Install

func (m *PluginManager) Install(ctx context.Context, name string, version string, values map[string]any) error

func (*PluginManager) ListInstalled

func (m *PluginManager) ListInstalled(ctx context.Context, checkHealthy bool) (map[string]PluginVersion, error)

func (*PluginManager) ListPlugins

func (m *PluginManager) ListPlugins(ctx context.Context) (map[string]Plugin, error)

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

type Requirement struct {
	Name       string
	Constraint string
}

Jump to

Keyboard shortcuts

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