Documentation ¶
Overview ¶
Package pluginmanager is responsible for plugin discovery and installation
Index ¶
- Constants
- func Clean() error
- func DeletePlugin(options DeletePluginOptions) error
- func DescribePlugin(pluginName string, target configtypes.Target) (info *cli.PluginInfo, err error)
- func DiscoverPluginGroups(options ...discovery.DiscoveryOptions) ([]*plugininventory.PluginGroup, error)
- func DiscoverPluginsForContextType(contextType configtypes.ContextType) ([]discovery.Discovered, error)
- func DiscoverPluginsFromLocalSource(localPath string) ([]discovery.Discovered, error)
- func DiscoverServerPlugins() ([]discovery.Discovered, error)
- func DiscoverStandalonePlugins(options ...discovery.DiscoveryOptions) ([]discovery.Discovered, error)
- func GetAdditionalTestPluginDiscoveries() []configtypes.PluginDiscovery
- func GetPluginGroup(groupIDAndVersion string, options ...PluginManagerOptions) (*plugininventory.PluginGroup, error)
- func InitializePlugin(plugin *cli.PluginInfo) error
- func InstallPluginsFromEssentialPluginGroup() (string, error)
- func InstallPluginsFromGivenPluginGroup(pluginName, groupIDAndVersion string, pg *plugininventory.PluginGroup) (string, error)
- func InstallPluginsFromGroup(pluginName, groupIDAndVersion string, options ...PluginManagerOptions) (string, error)
- func InstallPluginsFromLocalSource(pluginName, version string, target configtypes.Target, localPath string, ...) error
- func InstallStandalonePlugin(pluginName, version string, target configtypes.Target) error
- func IsPluginsFromPluginGroupInstalled(name, version string, options ...PluginManagerOptions) (bool, bool, error)
- func UpdatePluginsInstallationStatus(plugins []discovery.Discovered)
- func UpgradePlugin(pluginName, version string, target configtypes.Target) error
- type DeletePluginOptions
- type PluginManagerOptions
- type PluginManagerOpts
Constants ¶
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" )
const HTTP = "http"
const HTTPS = "https"
const True = "true"
Variables ¶
This section is empty.
Functions ¶
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
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.