pluginmanager

package
v1.24.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

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 Requirements, installs map[string]PluginVersion) error

func CheckDependecy

func CheckDependecy(requirements Requirements, 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, version string) ([]client.Object, error)

func SemVersionBiggerThan

func SemVersionBiggerThan(a, b string) int

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"`
	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
	// contains filtered or unexported fields
}

func DefaultPluginManager

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

func PluginManagerFromClient added in v1.23.2

func PluginManagerFromClient(cli client.Client) *PluginManager

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, withDpendeciesCheck bool) (*PluginVersion, error)

nolint funlen

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) UnInstall

func (m *PluginManager) UnInstall(ctx context.Context, name string) error

func (*PluginManager) UpdateRepo

func (p *PluginManager) UpdateRepo(ctx context.Context, repo *Repository) 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"`
	RepositoryName   string                      `json:"repositoryName,omitempty"`
	Version          string                      `json:"version,omitempty"`
	Healthy          bool                        `json:"healthy,omitempty"`
	Required         bool                        `json:"required,omitempty"`
	Requirements     Requirements                `json:"requirements,omitempty"` // dependecies requirements
	Message          string                      `json:"message,omitempty"`
	Values           pluginsv1beta1.Values       `json:"values,omitempty"`
	Files            map[string]string           `json:"files,omitempty"`
	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 *Repository, 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"`
	Static   bool                       `json:"static,omitempty"` // is static repository
	Plugins  map[string][]PluginVersion `json:"plugins,omitempty"`
	LastSync time.Time                  `json:"lastSync,omitempty"`
}

func (*Repository) ParseIndexFile

func (repository *Repository) ParseIndexFile(index *repo.IndexFile)

func (*Repository) RefreshRepoIndex

func (repository *Repository) RefreshRepoIndex(ctx context.Context) error

type Requirement

type Requirement struct {
	Name    string `json:"name,omitempty"`
	Expr    string `json:"expr,omitempty"`
	Message string `json:"message,omitempty"`
}

func ParseRequirements

func ParseRequirements(str string) []Requirement

ParseRequirements

type Requirements

type Requirements []Requirement

Jump to

Keyboard shortcuts

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