pluginmanager

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Overview

Package pluginmanager is responsible for plugin discovery and installation

Index

Constants

View Source
const (

	// ManifestFileName is the file name for the manifest.
	ManifestFileName = "manifest.yaml"
	// PluginManifestFileName is the file name for the manifest.
	PluginManifestFileName = "plugin_manifest.yaml"
	// PluginFileName is the file name for the plugin info.
	PluginFileName = "plugin.yaml"
)
View Source
const HTTP = "http"
View Source
const HTTPS = "https"
View Source
const True = "true"

Variables

This section is empty.

Functions

func Clean

func Clean() error

Clean deletes all plugins and tests.

func DeletePlugin

func DeletePlugin(options DeletePluginOptions) error

DeletePlugin deletes a plugin.

func DescribePlugin

func DescribePlugin(pluginName string, target configtypes.Target) (info *cli.PluginInfo, err error)

DescribePlugin describes a plugin.

func DiscoverPluginGroups added in v0.0.4

func DiscoverPluginGroups(options ...discovery.DiscoveryOptions) ([]*plugininventory.PluginGroup, error)

DiscoverPluginGroups returns the available plugin groups

func DiscoverPluginsForContextType added in v1.1.0

func DiscoverPluginsForContextType(contextType configtypes.ContextType) ([]discovery.Discovered, error)

func DiscoverPluginsFromLocalSource

func DiscoverPluginsFromLocalSource(localPath string) ([]discovery.Discovered, error)

DiscoverPluginsFromLocalSource returns the available plugins that are discovered from the provided local path

func DiscoverServerPlugins

func DiscoverServerPlugins() ([]discovery.Discovered, error)

DiscoverServerPlugins returns the available discovered plugins associated with all active contexts

func DiscoverStandalonePlugins

func DiscoverStandalonePlugins(options ...discovery.DiscoveryOptions) ([]discovery.Discovered, error)

DiscoverStandalonePlugins returns the available standalone plugins

func GetAdditionalTestPluginDiscoveries added in v1.0.0

func GetAdditionalTestPluginDiscoveries() []configtypes.PluginDiscovery

GetAdditionalTestPluginDiscoveries returns an array of plugin discoveries that are meant to be used for testing new plugin version. The comma-separated list of such discoveries can be specified through the environment variable "TANZU_CLI_ADDITIONAL_PLUGIN_DISCOVERY_IMAGES_TEST_ONLY". Each entry in the variable should be the URI of an OCI image of the DB of the discovery in question.

func GetPluginGroup added in v1.1.0

func GetPluginGroup(groupIDAndVersion string, options ...PluginManagerOptions) (*plugininventory.PluginGroup, error)

GetPluginGroup returns the plugin group for the specified groupIDAndVersion.

func InitializePlugin

func InitializePlugin(plugin *cli.PluginInfo) error

InitializePlugin initializes the plugin configuration

func InstallPluginsFromEssentialPluginGroup added in v1.0.0

func InstallPluginsFromEssentialPluginGroup() (string, error)

InstallPluginsFromEssentialPluginGroup is a function that installs or upgrades the essential plugin groups.

func InstallPluginsFromGivenPluginGroup added in v1.1.0

func InstallPluginsFromGivenPluginGroup(pluginName, groupIDAndVersion string, pg *plugininventory.PluginGroup) (string, error)

InstallPluginsFromGivenPluginGroup installs either the specified plugin or all plugins from given plugin group plugins.

func InstallPluginsFromGroup added in v0.0.4

func InstallPluginsFromGroup(pluginName, groupIDAndVersion string, options ...PluginManagerOptions) (string, error)

InstallPluginsFromGroup installs either the specified plugin or all plugins from the specified group version. If the group version is not specified, the latest available version will be used. The group identifier including the version used is returned.

func InstallPluginsFromLocalSource

func InstallPluginsFromLocalSource(pluginName, version string, target configtypes.Target, localPath string, installTestPlugin bool) error

InstallPluginsFromLocalSource installs plugin from local source directory

func InstallStandalonePlugin added in v0.0.4

func InstallStandalonePlugin(pluginName, version string, target configtypes.Target) error

InstallStandalonePlugin installs a plugin by name, version and target as a standalone plugin.

func IsPluginsFromPluginGroupInstalled added in v1.0.0

func IsPluginsFromPluginGroupInstalled(name, version string, options ...PluginManagerOptions) (bool, bool, error)

IsPluginsFromPluginGroupInstalled checks if all plugins from a specific group are installed and if a new version is available. This function uses cache data to verify rather than fetching the inventory image

func UpdatePluginsInstallationStatus added in v1.1.0

func UpdatePluginsInstallationStatus(plugins []discovery.Discovered)

UpdatePluginsInstallationStatus updates the installation status of the given plugins

func UpgradePlugin

func UpgradePlugin(pluginName, version string, target configtypes.Target) error

UpgradePlugin upgrades a plugin from the given repository.

Types

type DeletePluginOptions

type DeletePluginOptions struct {
	Target      configtypes.Target
	PluginName  string
	ForceDelete bool
}

type PluginManagerOptions added in v1.0.0

type PluginManagerOptions func(p *PluginManagerOpts)

func DisableLogs added in v1.0.0

func DisableLogs() PluginManagerOptions

func EnableLogs added in v1.0.0

func EnableLogs() PluginManagerOptions

type PluginManagerOpts added in v1.0.0

type PluginManagerOpts struct {
	// contains filtered or unexported fields
}

PluginManagerOpts options to customize plugin lifecycle operations

func NewPluginManagerOpts added in v1.0.0

func NewPluginManagerOpts(opts ...PluginManagerOptions) *PluginManagerOpts

NewPluginManagerOpts creates a new PluginManagerOpts instance with provided options.

func (*PluginManagerOpts) GetLogMode added in v1.0.0

func (p *PluginManagerOpts) GetLogMode() bool

GetLogMode sets the log mode based on the environment variable.

func (*PluginManagerOpts) ResetLogMode added in v1.0.0

func (p *PluginManagerOpts) ResetLogMode()

ResetLogMode reset the log mode to show logs

func (*PluginManagerOpts) SetLogMode added in v1.0.0

func (p *PluginManagerOpts) SetLogMode()

SetLogMode sets the log mode based on the environment variable.

Jump to

Keyboard shortcuts

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